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

1234

/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 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 DIntegerTest.java43 assertTrue(Integer.compare(max, max) == 0);
44 assertTrue(Integer.compare(min, min) == 0);
45 assertTrue(Integer.compare(zero, zero) == 0);
46 assertTrue(Integer.compare(max, zero) > 0);
47 assertTrue(Integer.compare(max, min) > 0);
48 assertTrue(Integer.compare(zero, max) < 0);
49 assertTrue(Integer.compare(zero, min) > 0);
50 assertTrue(Integer.compare(min, zero) < 0);
51 assertTrue(Integer.compare(min, max) < 0);
H A DLongTest.java41 assertTrue(Long.compare(max, max) == 0);
42 assertTrue(Long.compare(min, min) == 0);
43 assertTrue(Long.compare(zero, zero) == 0);
44 assertTrue(Long.compare(max, zero) > 0);
45 assertTrue(Long.compare(max, min) > 0);
46 assertTrue(Long.compare(zero, max) < 0);
47 assertTrue(Long.compare(zero, min) > 0);
48 assertTrue(Long.compare(min, zero) < 0);
49 assertTrue(Long.compare(min, max) < 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 DObjects.java29 * Returns 0 if {@code a == b}, or {@code c.compare(a, b)} otherwise.
32 public static <T> int compare(T a, T b, Comparator<? super T> c) { method in class:Objects
36 return c.compare(a, b);
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)
525 if (c.compare(key, a[base + hint]) > 0) {
528 while (ofs < maxOfs && c.compare(key, a[base + hint + ofs]) > 0) {
543 while (ofs < maxOfs && c.compare(key, a[base + hint - ofs]) <= 0) {
568 if (c.compare(key, a[base + m]) > 0)
596 if (c.compare(key, a[base + hint]) < 0) {
599 while (ofs < maxOfs && c.compare(ke
[all...]
H A DPriorityQueue.java353 private int compare(E o1, E o2) { method in class:PriorityQueue
355 return comparator.compare(o1, o2);
366 if (compare(parent, target) <= 0) {
380 && compare(elements[childIndex + 1], elements[childIndex]) < 0) {
383 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/dex/src/main/java/com/android/dex/util/
H A DUnsigned.java25 public static int compare(short ushortA, short ushortB) { method in class:Unsigned
34 public static int compare(int uintA, int uintB) { method in class:Unsigned
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/
H A DCollatorTest.java40 assertTrue("a) Failed on primary difference", c.compare(o, o2) < 0);
43 assertTrue("a) Failed on secondary difference", c.compare(o, o2) < 0);
46 assertTrue("a) Failed on tertiary difference", c.compare(o, o2) < 0);
49 assertTrue("a) Failed on identical", c.compare(o, o2) < 0);
52 assertEquals("a) Failed on equivalence", 0, c.compare(o, o2));
54 c.compare("\u01db", "v") < 0);
59 assertTrue("b) Failed on primary difference", c.compare(o, o2) < 0);
62 assertTrue("b) Failed on secondary difference", c.compare(o, o2) < 0);
65 assertTrue("b) Failed on tertiary difference", c.compare(o, o2) < 0);
68 assertEquals("b) Failed on identical", 0, c.compare(
[all...]
/libcore/dex/src/main/java/com/android/dex/
H A DFieldId.java48 return Unsigned.compare(declaringClassIndex, other.declaringClassIndex);
51 return Unsigned.compare(nameIndex, other.nameIndex);
53 return Unsigned.compare(typeIndex, other.typeIndex); // should always be 0
H A DMethodId.java48 return Unsigned.compare(declaringClassIndex, other.declaringClassIndex);
51 return Unsigned.compare(nameIndex, other.nameIndex);
53 return Unsigned.compare(protoIndex, other.protoIndex);
H A DProtoId.java36 return Unsigned.compare(returnTypeIndex, other.returnTypeIndex);
38 return Unsigned.compare(parametersOffset, other.parametersOffset);
H A DTypeList.java40 return Unsigned.compare(types[i], other.types[i]);
43 return Unsigned.compare(types.length, other.types.length);
/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.java187 public int compare(String source, String target) { method in class:RuleBasedCollator
193 return icuColl.compare(source, target);
220 * the object to compare with this object.
/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);
133 public static int compare(boolean lhs, boolean rhs) { method in class:Boolean
/libcore/luni/src/test/java/libcore/java/util/
H A DCollectionsTest.java153 public int compare(Integer lhs, Integer rhs) {
154 final int compare = lhs.compareTo(rhs);
155 if (compare == 0) {
157 } else if (compare < 0) {
183 public int compare(Integer lhs, Integer rhs) {
H A DObjectsTest.java28 assertEquals(0, Objects.compare(null, null, String.CASE_INSENSITIVE_ORDER));
29 assertEquals(0, Objects.compare("a", "A", String.CASE_INSENSITIVE_ORDER));
30 assertEquals(-1, Objects.compare("a", "b", String.CASE_INSENSITIVE_ORDER));
31 assertEquals(1, Objects.compare("b", "a", String.CASE_INSENSITIVE_ORDER));
/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.java26 public static native int compare(long address, String source, String target); method in class:NativeCollation
/libcore/luni/src/test/java/libcore/icu/
H A DICUTest.java215 assertTrue(c.compare("2", "11") < 0);
216 assertTrue(c.compare("11", "ae") < 0);
217 assertTrue(c.compare("ae", "Ä") < 0);
218 assertTrue(c.compare("Ä", "ä") < 0);
219 assertTrue(c.compare("ä", "AF") < 0);
220 assertTrue(c.compare("AF", "af") < 0);

Completed in 444 milliseconds

1234