Searched refs:compare (Results 1 - 25 of 56) sorted by relevance

123

/libcore/luni/src/test/java/libcore/java/lang/
H A DByteTest.java24 assertTrue(Byte.compare(max, max) == 0);
25 assertTrue(Byte.compare(min, min) == 0);
26 assertTrue(Byte.compare(zero, zero) == 0);
27 assertTrue(Byte.compare(max, zero) > 0);
28 assertTrue(Byte.compare(max, min) > 0);
29 assertTrue(Byte.compare(zero, max) < 0);
30 assertTrue(Byte.compare(zero, min) > 0);
31 assertTrue(Byte.compare(min, zero) < 0);
32 assertTrue(Byte.compare(min, max) < 0);
H A DIntegerTest.java24 assertTrue(Integer.compare(max, max) == 0);
25 assertTrue(Integer.compare(min, min) == 0);
26 assertTrue(Integer.compare(zero, zero) == 0);
27 assertTrue(Integer.compare(max, zero) > 0);
28 assertTrue(Integer.compare(max, min) > 0);
29 assertTrue(Integer.compare(zero, max) < 0);
30 assertTrue(Integer.compare(zero, min) > 0);
31 assertTrue(Integer.compare(min, zero) < 0);
32 assertTrue(Integer.compare(min, max) < 0);
H A DShortTest.java24 assertTrue(Short.compare(max, max) == 0);
25 assertTrue(Short.compare(min, min) == 0);
26 assertTrue(Short.compare(zero, zero) == 0);
27 assertTrue(Short.compare(max, zero) > 0);
28 assertTrue(Short.compare(max, min) > 0);
29 assertTrue(Short.compare(zero, max) < 0);
30 assertTrue(Short.compare(zero, min) > 0);
31 assertTrue(Short.compare(min, zero) < 0);
32 assertTrue(Short.compare(min, max) < 0);
H A DBooleanTest.java31 assertEquals(0, Boolean.compare(true, true));
32 assertEquals(0, Boolean.compare(false, false));
33 assertTrue(Boolean.compare(false, true) < 0);
34 assertTrue(Boolean.compare(true, false) > 0);
H A DLongTest.java24 assertTrue(Long.compare(max, max) == 0);
25 assertTrue(Long.compare(min, min) == 0);
26 assertTrue(Long.compare(zero, zero) == 0);
27 assertTrue(Long.compare(max, zero) > 0);
28 assertTrue(Long.compare(max, min) > 0);
29 assertTrue(Long.compare(zero, max) < 0);
30 assertTrue(Long.compare(zero, min) > 0);
31 assertTrue(Long.compare(min, zero) < 0);
32 assertTrue(Long.compare(min, max) < 0);
H A DCharacterTest.java110 assertEquals(0, Character.compare('a', 'a'));
111 assertTrue(Character.compare('a', 'b') < 0);
112 assertTrue(Character.compare('b', 'a') > 0);
/libcore/luni/src/main/java/java/util/
H A DComparator.java21 * A {@code Comparator} is used to compare two objects to determine their ordering with
24 * to be <i>consistent with equals</i>, its {code #compare(Object, Object)}
38 * <li>{@code compare(a,a)} returns zero for all {@code a}</li>
39 * <li>the sign of {@code compare(a,b)} must be the opposite of the sign of {@code
40 * compare(b,a)} for all pairs of (a,b)</li>
41 * <li>From {@code compare(a,b) > 0} and {@code compare(b,c) > 0} it must
42 * follow {@code compare(a,c) > 0} for all possible combinations of {@code
49 * a second {@code Object} to compare with {@code lhs}.
55 public int compare( method in interface:Comparator
[all...]
H A DTimSort.java261 if (c.compare(pivot, a[mid]) < 0)
320 if (c.compare(a[runHi++], a[lo]) < 0) { // Descending
321 while(runHi < hi && c.compare(a[runHi], a[runHi - 1]) < 0)
325 while (runHi < hi && c.compare(a[runHi], a[runHi - 1]) >= 0)
507 if (c.compare(key, a[base + hint]) > 0) {
510 while (ofs < maxOfs && c.compare(key, a[base + hint + ofs]) > 0) {
525 while (ofs < maxOfs && c.compare(key, a[base + hint - ofs]) <= 0) {
550 if (c.compare(key, a[base + m]) > 0)
578 if (c.compare(key, a[base + hint]) < 0) {
581 while (ofs < maxOfs && c.compare(ke
[all...]
H A DPriorityQueue.java349 private int compare(E o1, E o2) { method in class:PriorityQueue
351 return comparator.compare(o1, o2);
362 if (compare(parent, target) <= 0) {
376 && compare(elements[childIndex + 1], elements[childIndex]) < 0) {
379 if (compare(target, elements[childIndex]) <= 0) {
H A DTreeSet.java171 * Returns the comparator used to compare elements in this {@code TreeSet}.
358 int compare = (c == null) ? ((Comparable<E>) start).compareTo(end) : c
359 .compare(start, end);
360 if (compare <= 0) {
380 c.compare(end, end);
398 c.compare(start, start);
/libcore/luni/src/test/java/libcore/java/text/
H A DOldDecimalFormatTest.java600 private void compare(String testName, String format, String expected) { method in class:OldDecimalFormatTest
605 private boolean compare(int count, String format, String expected) { method in class:OldDecimalFormatTest
624 compare("00.0#E0: 0.0", df.format(0.0), "00.0E0");
625 compare("00.0#E0: 1.0", df.format(1.0), "10.0E-1");
626 compare("00.0#E0: 12.0", df.format(12.0), "12.0E0");
627 compare("00.0#E0: 123.0", df.format(123.0), "12.3E1");
628 compare("00.0#E0: 1234.0", df.format(1234.0), "12.34E2");
629 compare("00.0#E0: 12346.0", df.format(12346.0), "12.35E3");
630 compare("00.0#E0: 99999.0", df.format(99999.0), "10.0E4");
631 compare("00.
[all...]
/libcore/luni/src/main/java/java/text/
H A DCollator.java78 * if (usCollator.compare(&quot;abc&quot;, &quot;ABC&quot;) == 0) {
85 * The following example shows how to compare two strings using the collator for
93 * if (myCollator.compare(&quot;\u00e0\u0325&quot;, &quot;a\u0325\u0300&quot;) != 0) {
96 * if (myCollator.compare(&quot;\u00e0\u0325&quot;, &quot;a\u0325\u0300&quot;) != 0) {
184 * the first string to compare.
186 * the second string to compare.
193 public int compare(Object object1, Object object2) { method in class:Collator
194 return compare((String) object1, (String) object2);
201 * the first string to compare.
203 * the second string to compare
208 public abstract int compare(String string1, String string2); method in class:Collator
[all...]
H A DRuleBasedCollator.java131 * This allows you to use a RuleBasedCollator to compare accented strings even
376 * {@code RuleBasedCollator.compare(String, String)} has better performance.
387 public int compare(String source, String target) { method in class:RuleBasedCollator
393 return icuColl.compare(source, target);
420 * the object to compare with this object.
/libcore/luni/src/test/java/tests/api/java/lang/
H A DStringTest.java47 assertTrue(String.CASE_INSENSITIVE_ORDER.compare(s1, s2) == 0);
/libcore/luni/src/test/java/tests/java/lang/String/
H A DTests.java46 assertTrue(String.CASE_INSENSITIVE_ORDER.compare(s1, s2) == 0);
/libcore/luni/src/main/java/java/lang/
H A DBoolean.java99 * the object to compare this boolean with.
114 * the boolean object to compare this object to.
124 return compare(value, that.value);
134 public static int compare(boolean lhs, boolean rhs) { method in class:Boolean
H A DByte.java100 * the byte object to compare this object to.
109 return compare(value, object.value);
118 public static int compare(byte lhs, byte rhs) { method in class:Byte
154 * the object to compare this byte with.
H A DShort.java97 * the short object to compare this object to.
108 return compare(value, object.value);
117 public static int compare(long lhs, long rhs) { method in class:Short
154 * the object to compare this short with.
/libcore/luni/src/main/java/libcore/icu/
H A DRuleBasedCollatorICU.java66 public int compare(String source, String target) { method in class:RuleBasedCollatorICU
67 return NativeCollation.compare(address, source, target);
131 return (compare(source, target) == 0);
H A DNativeCollation.java24 public static native int compare(int address, String source, String target); method in class:NativeCollation
/libcore/luni/src/test/java/libcore/java/util/
H A DOldPriorityQueueTest.java86 public int compare(String object1, String object2) { method in class:OldPriorityQueueTest.MockComparatorStringByLength
102 public int compare(E object1, E object2) { method in class:OldPriorityQueueTest.MockComparatorCast
H A DTreeSetTest.java44 assertEquals(0, deserialized.comparator().compare("X", "x"));
132 assertEquals(0, deserialized.comparator().compare("X", "x"));
/libcore/luni/src/main/java/javax/xml/datatype/
H A DXMLGregorianCalendar.java160 * <li>partial order relation comparator method, {@link #compare(XMLGregorianCalendar xmlGregorianCalendar)}</li>
161 * <li>{@link #equals(Object)} defined relative to {@link #compare(XMLGregorianCalendar xmlGregorianCalendar)}.</li>
631 * @param xmlGregorianCalendar Instance of <code>XMLGregorianCalendar</code> to compare
642 public abstract int compare(XMLGregorianCalendar xmlGregorianCalendar); method in class:XMLGregorianCalendar
657 * @param obj to compare.
660 * and {@link #compare(XMLGregorianCalendar obj)} returns {@link DatatypeConstants#EQUAL}, otherwise <code>false</code>.
667 return compare((XMLGregorianCalendar) obj) == DatatypeConstants.EQUAL;
679 // Following two dates compare to EQUALS since in different timezones.
H A DDuration.java57 * The {@link #compare(Duration duration)} method implements this
747 * @param duration to compare
762 public abstract int compare(final Duration duration); method in class:Duration
788 * @see #compare(Duration duration)
791 return compare(duration) == DatatypeConstants.GREATER;
810 * @see #compare(Duration duration)
813 return compare(duration) == DatatypeConstants.LESSER;
851 * @see #compare(Duration duration)
858 return compare((Duration) duration) == DatatypeConstants.EQUAL;
/libcore/luni/src/main/java/org/apache/harmony/security/x501/
H A DAttributeTypeAndValueComparator.java47 public int compare(Object obj1, Object obj2) { method in class:AttributeTypeAndValueComparator

Completed in 285 milliseconds

123