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

12345

/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 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);
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);
/libcore/benchmarks/src/benchmarks/regression/
H A DCollatorBenchmark.java31 collator.compare("abcde", "abcdf");
32 collator.compare("abcde", "abcde");
33 collator.compare("abcdf", "abcde");
40 collator.compare("abcdÂ", "abcdÄ");
41 collator.compare("abcdÂ", "abcdÂ");
42 collator.compare("abcdÄ", "abcdÂ");
49 collator.compare("abcdE", "abcde");
50 collator.compare("abcde", "abcde");
51 collator.compare("abcde", "abcdE");
58 collator.compare("abc
[all...]
/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/ojluni/src/main/java/sun/security/util/
H A DByteArrayTagOrder.java42 * as defined in ITU-T X.680, sec. 6.4. (First compare
45 * @param bytes1 first byte array to compare.
46 * @param bytes2 second byte array to compare.
54 public final int compare(byte[] bytes1, byte[] bytes2) { method in class:ByteArrayTagOrder
H A DByteArrayLexOrder.java40 * regarding each byte as unsigned. That is, compare array entries
45 * @param bytes1 first byte array to compare.
46 * @param bytes2 second byte array to compare.
53 public final int compare( byte[] bytes1, byte[] bytes2) { method in class:ByteArrayLexOrder
/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/ojluni/src/main/java/java/util/function/
H A DBinaryOperator.java59 return (a, b) -> comparator.compare(a, b) <= 0 ? a : b;
74 return (a, b) -> comparator.compare(a, b) >= 0 ? a : b;
/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/ojluni/src/main/java/java/util/
H A DComparators.java51 public int compare(Comparable<Object> c1, Comparable<Object> c2) { method in class:Comparators.NaturalOrderComparator
77 public int compare(T a, T b) { method in class:Comparators.NullComparator
83 return (real == null) ? 0 : real.compare(a, b);
H A DComparator.java47 * <tt>c.compare(e1, e2)==0</tt> has the same boolean value as
61 * {@code (a.equals(b) && c.compare(a, b) != 0)}
78 * {(x, y) such that c.compare(x, y) &lt;= 0}.
80 * {(x, y) such that c.compare(x, y) == 0}.
83 * It follows immediately from the contract for <tt>compare</tt> that the
121 * The implementor must ensure that <tt>sgn(compare(x, y)) ==
122 * -sgn(compare(y, x))</tt> for all <tt>x</tt> and <tt>y</tt>. (This
123 * implies that <tt>compare(x, y)</tt> must throw an exception if and only
124 * if <tt>compare(y, x)</tt> throws an exception.)<p>
127 * <tt>((compare(
150 int compare(T o1, T o2); method in interface:Comparator
[all...]
H A DObjects.java164 * c.compare(a, b)} otherwise.
176 * @param c the {@code Comparator} to compare the first two arguments
178 * c.compare(a, b)} otherwise.
182 public static <T> int compare(T a, T b, Comparator<? super T> c) { method in class:Objects
183 return (a == b) ? 0 : c.compare(a, b);
H A DTimSort.java292 if (c.compare(pivot, a[mid]) < 0)
351 if (c.compare(a[runHi++], a[lo]) < 0) { // Descending
352 while (runHi < hi && c.compare(a[runHi], a[runHi - 1]) < 0)
356 while (runHi < hi && c.compare(a[runHi], a[runHi - 1]) >= 0)
538 if (c.compare(key, a[base + hint]) > 0) {
541 while (ofs < maxOfs && c.compare(key, a[base + hint + ofs]) > 0) {
556 while (ofs < maxOfs && c.compare(key, a[base + hint - ofs]) <= 0) {
581 if (c.compare(key, a[base + m]) > 0)
609 if (c.compare(key, a[base + hint]) < 0) {
612 while (ofs < maxOfs && c.compare(ke
[all...]
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
H A DMinMaxTest.java55 assertTrue(!countTo(0).stream().min(Integer::compare).isPresent());
56 assertTrue(!countTo(0).stream().max(Integer::compare).isPresent());
57 assertEquals(1, (int) countTo(1000).stream().min(Integer::compare).get());
58 assertEquals(1000, (int) countTo(1000).stream().max(Integer::compare).get());
63 exerciseTerminalOps(data, s -> s.min(Integer::compare));
64 exerciseTerminalOps(data, s -> s.max(Integer::compare));
/libcore/luni/src/test/java/tests/java/lang/String/
H A DTests.java46 assertTrue(String.CASE_INSENSITIVE_ORDER.compare(s1, s2) == 0);
/libcore/ojluni/src/main/java/java/text/
H A DCollator.java67 * The following example shows how to compare two strings using
73 * if( myCollator.compare("abc", "ABC") < 0 )
96 * if( usCollator.compare("abc", "ABC") == 0 ) {
102 * For comparing <code>String</code>s exactly once, the <code>compare</code>
104 * <code>String</code>s however, it is generally necessary to compare each
316 public abstract int compare(String source, String target); method in class:Collator
324 * <code> compare((String)o1, (String)o2) </code>.
333 public int compare(Object o1, Object o2) { method in class:Collator
334 return compare((String) o1, (String) o2);
340 * Collator.compare whe
[all...]
H A DRuleBasedCollator.java155 * This allows you to use a RuleBasedCollator to compare accented strings
262 // need to be preserved in these objects between calls to compare() or
264 // creation time. compare() and getCollationKey() are synchronized to ensure
354 public synchronized int compare(String source, String target) { method in class:RuleBasedCollator
358 return icuColl.compare(source, target);
/libcore/ojluni/src/main/java/java/lang/
H A DBoolean.java220 * @param obj the object to compare with.
271 return compare(this.value, b.value);
281 * @param x the first {@code boolean} to compare
282 * @param y the second {@code boolean} to compare
288 public static int compare(boolean x, boolean y) { method in class:Boolean
/libcore/luni/src/test/java/libcore/java/util/
H A DObjectsTest.java29 assertEquals(0, Objects.compare(null, null, String.CASE_INSENSITIVE_ORDER));
30 assertEquals(0, Objects.compare("a", "A", String.CASE_INSENSITIVE_ORDER));
31 assertEquals(-1, Objects.compare("a", "b", String.CASE_INSENSITIVE_ORDER));
32 assertEquals(1, Objects.compare("b", "a", String.CASE_INSENSITIVE_ORDER));

Completed in 1105 milliseconds

12345