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

123456

/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/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);
165 assertEquals(Integer.compare(
[all...]
H A DLongTest.java42 assertTrue(Long.compare(max, max) == 0);
43 assertTrue(Long.compare(min, min) == 0);
44 assertTrue(Long.compare(zero, zero) == 0);
45 assertTrue(Long.compare(max, zero) > 0);
46 assertTrue(Long.compare(max, min) > 0);
47 assertTrue(Long.compare(zero, max) < 0);
48 assertTrue(Long.compare(zero, min) > 0);
49 assertTrue(Long.compare(min, zero) < 0);
50 assertTrue(Long.compare(min, max) < 0);
173 assertEquals(Integer.compare(
[all...]
/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/tools/upstream/
H A DAndroid.mk22 LOCAL_MODULE := libcore-compare-upstreams
24 LOCAL_JAR_MANIFEST := src/main/libcore-compare-upstreams.mf
/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.java296 if (c.compare(pivot, a[mid]) < 0)
355 if (c.compare(a[runHi++], a[lo]) < 0) { // Descending
356 while (runHi < hi && c.compare(a[runHi], a[runHi - 1]) < 0)
360 while (runHi < hi && c.compare(a[runHi], a[runHi - 1]) >= 0)
542 if (c.compare(key, a[base + hint]) > 0) {
545 while (ofs < maxOfs && c.compare(key, a[base + hint + ofs]) > 0) {
560 while (ofs < maxOfs && c.compare(key, a[base + hint - ofs]) <= 0) {
585 if (c.compare(key, a[base + m]) > 0)
613 if (c.compare(key, a[base + hint]) < 0) {
616 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
258 public abstract int compare(String source, String target); method in class:Collator
266 * <code> compare((String)o1, (String)o2) </code>.
276 public int compare(Object o1, Object o2) { method in class:Collator
277 return compare((String)o1, (String)o2);
283 * Collator.compare whe
[all...]
H A DRuleBasedCollator.java155 * This allows you to use a RuleBasedCollator to compare accented strings
258 // need to be preserved in these objects between calls to compare() or
260 // creation time. compare() and getCollationKey() are synchronized to ensure
362 public synchronized int compare(String source, String target) method in class:RuleBasedCollator
368 return icuColl.compare(source, target);
/libcore/ojluni/src/main/java/java/lang/
H A DBoolean.java221 * @param obj the object to compare with.
273 return compare(this.value, b.value);
283 * @param x the first {@code boolean} to compare
284 * @param y the second {@code boolean} to compare
290 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));
/libcore/ojluni/src/main/java/java/nio/
H A DIntBuffer.java780 * {@link Integer#compare(int,int)}.
791 int cmp = compare(this.get(i), that.get(j));
798 private static int compare(int x, int y) { method in class:IntBuffer
801 return Integer.compare(x, y);
H A DLongBuffer.java773 * {@link Long#compare(long,long)}.
784 int cmp = compare(this.get(i), that.get(j));
791 private static int compare(long x, long y) { method in class:LongBuffer
794 return Long.compare(x, y);
H A DShortBuffer.java773 * {@link Short#compare(short,short)}.
784 int cmp = compare(this.get(i), that.get(j));
791 private static int compare(short x, short y) { method in class:ShortBuffer
794 return Short.compare(x, y);
/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.

Completed in 1051 milliseconds

123456