Searched refs:compareTo (Results 1 - 25 of 126) sorted by relevance

123456

/libcore/luni/src/main/java/java/lang/
H A DComparable.java26 * The order rule must be both transitive (if {@code x.compareTo(y) < 0} and
27 * {@code y.compareTo(z) < 0}, then {@code x.compareTo(z) < 0} must hold) and
28 * invertible (the sign of the result of x.compareTo(y) must be equal to the
29 * negation of the sign of the result of y.compareTo(x) for all combinations of
33 * result of x.compareTo(y) is zero, then the result of x.equals(y) should be
52 int compareTo(T another); method in interface:Comparable
/libcore/luni/src/main/java/java/text/
H A DCollationKey.java30 * Both the method {@code CollationKey.compareTo(CollationKey)} and the method
38 * {@code CollationKey.compareTo(CollationKey)} executes, it performs bitwise
65 * if( keys[i].compareTo( keys[j] ) &gt; 0 )
95 public abstract int compareTo(CollationKey value); method in class:CollationKey
/libcore/luni/src/test/java/libcore/java/lang/
H A DOldAndroidEnumTest.java40 assertTrue(MyEnum.ZERO.compareTo(MyEnum.ONE) < 0);
42 assertTrue(MyEnum.TWO.compareTo(MyEnum.ONE) > 0);
43 assertTrue(MyEnum.FOUR.compareTo(MyEnum.ONE) > 0);
H A DStringTest.java342 assertEquals(-1, "a".compareTo("b"));
343 assertEquals(-2, "a".compareTo("c"));
344 assertEquals(1, "b".compareTo("a"));
345 assertEquals(2, "c".compareTo("a"));
349 assertEquals(0, "a".compareTo("a"));
350 assertEquals(-1, "a".compareTo("aa"));
351 assertEquals(-1, "a".compareTo("az"));
352 assertEquals(-2, "a".compareTo("aaa"));
353 assertEquals(-2, "a".compareTo("azz"));
354 assertEquals(-3, "a".compareTo("aaa
[all...]
/libcore/luni/src/test/java/libcore/java/math/
H A DOldBigDecimalScaleOperationsTest.java86 assertEquals(0, x1.compareTo(x2));
87 assertEquals(0, x2.compareTo(x1));
91 assertEquals(0, x1.compareTo(x2));
92 assertEquals(0, x2.compareTo(x1));
96 assertEquals(0, x1.compareTo(x2));
97 assertEquals(0, x2.compareTo(x1));
/libcore/dex/src/main/java/com/android/dex/
H A DAnnotation.java54 @Override public int compareTo(Annotation other) { method in class:Annotation
55 return encodedAnnotation.compareTo(other.encodedAnnotation);
H A DEncodedValue.java44 @Override public int compareTo(EncodedValue other) { method in class:EncodedValue
H A DFieldId.java46 public int compareTo(FieldId other) { method in class:FieldId
H A DMethodId.java46 public int compareTo(MethodId other) { method in class:MethodId
H A DProtoId.java34 public int compareTo(ProtoId other) { method in class:ProtoId
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/
H A DMacThread.java52 if (sign1.compareTo(sign2) != 0 || sign1.compareTo(sign3) == 0 ||
53 sign2.compareTo(sign3) == 0) {
/libcore/luni/src/main/java/libcore/icu/
H A DCollationKeyICU.java34 @Override public int compareTo(CollationKey other) { method in class:CollationKeyICU
81 return compareTo((CollationKey) object) == 0;
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/
H A DBooleanTest.java143 * java.lang.Boolean#compareTo(Boolean)
146 assertTrue(Boolean.TRUE.compareTo(Boolean.TRUE) == 0);
147 assertTrue(Boolean.FALSE.compareTo(Boolean.FALSE) == 0);
148 assertTrue(Boolean.TRUE.compareTo(Boolean.FALSE) > 0);
149 assertTrue(Boolean.FALSE.compareTo(Boolean.TRUE) < 0);
152 Boolean.TRUE.compareTo(null);
H A DByteTest.java354 * java.lang.Byte#compareTo(Byte)
361 assertTrue(max.compareTo(max) == 0);
362 assertTrue(min.compareTo(min) == 0);
363 assertTrue(zero.compareTo(zero) == 0);
365 assertTrue(max.compareTo(zero) > 0);
366 assertTrue(max.compareTo(min) > 0);
368 assertTrue(zero.compareTo(max) < 0);
369 assertTrue(zero.compareTo(min) > 0);
371 assertTrue(min.compareTo(zero) < 0);
372 assertTrue(min.compareTo(ma
[all...]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/
H A DBigIntegerCompareTest.java28 * Methods: abs, compareTo, equals, max, min, negate, signum
66 * compareTo(BigInteger a).
77 assertEquals(1, aNumber.compareTo(bNumber));
81 * compareTo(BigInteger a).
92 assertEquals(-1, aNumber.compareTo(bNumber));
96 * compareTo(BigInteger a).
106 assertEquals(0, aNumber.compareTo(bNumber));
110 * compareTo(BigInteger a).
121 assertEquals(-1, aNumber.compareTo(bNumber));
125 * compareTo(BigIntege
[all...]
H A DOldBigIntegerTest.java52 assertTrue("Random number is negative", bi.compareTo(BigInteger.ZERO) >= 0);
53 assertTrue("Random number is too big", bi.compareTo(two.pow(70)) < 0);
74 assertTrue(bi1 + " is negative", bi1.compareTo(BigInteger.ZERO) >= 0);
75 assertTrue(bi1 + " is too big", bi1.compareTo(new BigInteger("1024", 10)) < 0);
76 assertTrue(bi2 + " is negative", bi2.compareTo(BigInteger.ZERO) >= 0);
77 assertTrue(bi2 + " is too big", bi2.compareTo(new BigInteger("1024", 10)) < 0);
/libcore/luni/src/main/java/java/security/spec/
H A DECParameterSpec.java70 if (!(this.order.compareTo(BigInteger.ZERO) > 0)) {
H A DEllipticCurve.java84 if (this.a.signum() < 0 || this.a.compareTo(p) >= 0) {
87 if (this.b.signum() < 0 || this.b.compareTo(p) >= 0) {
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/
H A DCollationKeyTest.java28 * @tests java.text.CollationKey#compareTo(java.text.CollationKey)
35 assertEquals("Should be equal", 0, key1.compareTo(key2));
39 * @tests java.text.CollationKey#compareTo(java.lang.Object)
43 // java.text.CollationKey.compareTo(java.lang.Object)
48 assertEquals("Should be equal", 0, key1.compareTo(key2));
/libcore/luni/src/main/java/java/util/
H A DComparableTimSort.java26 * comparator that simply returns {@code ((Comparable)first).compareTo(Second)}.
228 if (pivot.compareTo(a[mid]) < 0)
286 if (((Comparable) a[runHi++]).compareTo(a[lo]) < 0) { // Descending
287 while(runHi < hi && ((Comparable) a[runHi]).compareTo(a[runHi - 1]) < 0)
291 while (runHi < hi && ((Comparable) a[runHi]).compareTo(a[runHi - 1]) >= 0)
492 if (key.compareTo(a[base + hint]) > 0) {
495 while (ofs < maxOfs && key.compareTo(a[base + hint + ofs]) > 0) {
510 while (ofs < maxOfs && key.compareTo(a[base + hint - ofs]) <= 0) {
535 if (key.compareTo(a[base + m]) > 0)
562 if (key.compareTo(
[all...]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/
H A DFloatBufferTest.java162 buf.compareTo(null);
169 assertEquals(0, buf.compareTo(buf));
176 assertEquals(0, buf.compareTo(other));
177 assertEquals(0, other.compareTo(buf));
179 assertTrue(buf.compareTo(other) > 0);
180 assertTrue(other.compareTo(buf) < 0);
182 assertTrue(buf.compareTo(other) < 0);
183 assertTrue(other.compareTo(buf) > 0);
186 assertTrue(buf.compareTo(other) > 0);
187 assertTrue(other.compareTo(bu
[all...]
H A DDoubleBufferTest.java186 assertEquals(0, buf.compareTo(other));
187 assertEquals(0, other.compareTo(buf));
189 assertTrue(buf.compareTo(other) > 0);
190 assertTrue(other.compareTo(buf) < 0);
192 assertTrue(buf.compareTo(other) < 0);
193 assertTrue(other.compareTo(buf) > 0);
196 assertTrue(buf.compareTo(other) > 0);
197 assertTrue(other.compareTo(buf) < 0);
204 .compareTo(dbuffer2));
206 .compareTo(dbuffer
[all...]
/libcore/luni/src/test/java/libcore/java/util/
H A DCollectionsTest.java119 * A value type whose {@code compareTo} method returns one of {@code 0},
131 public int compareTo(IntegerWithExtremeComparator another) { method in class:CollectionsTest.IntegerWithExtremeComparator
154 final int compare = lhs.compareTo(rhs);
184 return lhs.compareTo(rhs);
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/security/cert/
H A DX509CertificateTest.java275 .compareTo(na_date) > 0);
277 .compareTo(nb_date) < 0);
280 date.compareTo(na_date) > 0);
283 date.compareTo(nb_date) < 0);
323 .compareTo(na_date) > 0);
325 .compareTo(nb_date) < 0);
328 date[i].compareTo(na_date) > 0);
331 + "was thrown", date[i].compareTo(nb_date) < 0);
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/charset/
H A DCharsetTest.java567 assertEquals(0, c1.compareTo(c1));
570 assertEquals(0, c1.compareTo(c2));
573 assertTrue(c1.compareTo(c2) < 0);
574 assertTrue(c2.compareTo(c1) > 0);
577 assertTrue(c1.compareTo(c2) > 0);
578 assertTrue(c2.compareTo(c1) < 0);
581 assertTrue(c1.compareTo(c2) > 0);
582 assertTrue(c2.compareTo(c1) < 0);
585 assertEquals("mock".compareToIgnoreCase("m:"), c1.compareTo(c2));
586 assertEquals("m:".compareToIgnoreCase("mock"), c2.compareTo(c
[all...]

Completed in 9604 milliseconds

123456