/libcore/luni/src/main/java/java/util/ |
D | PriorityQueue.java | 47 private Comparator<? super E> comparator; field in PriorityQueue 83 public PriorityQueue(int initialCapacity, Comparator<? super E> comparator) { in PriorityQueue() argument 88 this.comparator = comparator; in PriorityQueue() 229 public Comparator<? super E> comparator() { in comparator() method in PriorityQueue 230 return comparator; in comparator() 327 comparator = (Comparator<? super E>) c.comparator(); in getFromPriorityQueue() 335 comparator = (Comparator<? super E>) c.comparator(); in getFromSortedSet() 354 if (comparator != null) { in compare() 355 return comparator.compare(o1, o2); in compare()
|
D | TreeSet.java | 78 public TreeSet(Comparator<? super E> comparator) { in TreeSet() argument 79 backingMap = new TreeMap<E, Object>(comparator); in TreeSet() 90 this(set.comparator()); in TreeSet() 175 public Comparator<? super E> comparator() { in comparator() method in TreeSet 176 return backingMap.comparator(); in comparator() 357 Comparator<? super E> c = backingMap.comparator(); in subSet() 376 Comparator<? super E> c = backingMap.comparator(); in headSet() 394 Comparator<? super E> c = backingMap.comparator(); in tailSet() 474 stream.writeObject(backingMap.comparator()); in writeObject()
|
D | TreeMap.java | 76 Comparator<? super K> comparator; field in TreeMap 87 this.comparator = (Comparator<? super K>) NATURAL_ORDER; in TreeMap() 120 public TreeMap(Comparator<? super K> comparator) { in TreeMap() argument 121 if (comparator != null) { in TreeMap() 122 this.comparator = comparator; in TreeMap() 124 this.comparator = (Comparator<? super K>) NATURAL_ORDER; in TreeMap() 144 Comparator<? super K> sourceComparator = copyFrom.comparator(); in TreeMap() 146 this.comparator = sourceComparator; in TreeMap() 148 this.comparator = (Comparator<? super K>) NATURAL_ORDER; in TreeMap() 253 if (comparator == NATURAL_ORDER && !(key instanceof Comparable)) { in find() [all …]
|
D | SortedSet.java | 38 public Comparator<? super E> comparator(); in comparator() method
|
D | SortedMap.java | 31 public Comparator<? super K> comparator(); in comparator() method
|
D | Collections.java | 205 ReverseComparator2(Comparator<T> comparator) { in ReverseComparator2() argument 206 this.cmp = comparator; in ReverseComparator2() 813 @Override public Comparator<? super K> comparator() { 815 return sm.comparator(); 874 @Override public Comparator<? super E> comparator() { 876 return ss.comparator(); 1332 @Override public Comparator<? super K> comparator() { 1333 return sm.comparator(); 1368 @Override public Comparator<? super E> comparator() { 1369 return ss.comparator(); [all …]
|
D | Arrays.java | 552 public static <T> int binarySearch(T[] array, T value, Comparator<? super T> comparator) { in binarySearch() argument 553 return binarySearch(array, 0, array.length, value, comparator); in binarySearch() 578 Comparator<? super T> comparator) { in binarySearch() argument 579 if (comparator == null) { in binarySearch() 589 int midValCmp = comparator.compare(array[mid], value); in binarySearch() 1997 public static <T> void sort(T[] array, int start, int end, Comparator<? super T> comparator) { in sort() argument 1998 TimSort.sort(array, start, end, comparator); in sort() 2009 public static <T> void sort(T[] array, Comparator<? super T> comparator) { in sort() argument 2010 TimSort.sort(array, comparator); in sort()
|
/libcore/luni/src/main/java/java/util/concurrent/ |
D | PriorityBlockingQueue.java | 122 private transient Comparator<? super E> comparator; field in PriorityBlockingQueue 181 Comparator<? super E> comparator) { in PriorityBlockingQueue() argument 186 this.comparator = comparator; in PriorityBlockingQueue() 213 this.comparator = (Comparator<? super E>) ss.comparator(); in PriorityBlockingQueue() 219 this.comparator = (Comparator<? super E>) pq.comparator(); in PriorityBlockingQueue() 229 if (screen && (n == 1 || this.comparator != null)) { in PriorityBlockingQueue() 292 Comparator<? super E> cmp = comparator; in dequeue() 402 Comparator<? super E> cmp = comparator; in heapify() 448 Comparator<? super E> cmp = comparator; in offer() 550 public Comparator<? super E> comparator() { in comparator() method in PriorityBlockingQueue [all …]
|
D | ConcurrentSkipListSet.java | 84 public ConcurrentSkipListSet(Comparator<? super E> comparator) { in ConcurrentSkipListSet() argument 85 m = new ConcurrentSkipListMap<E,Object>(comparator); in ConcurrentSkipListSet() 113 m = new ConcurrentSkipListMap<E,Object>(s.comparator()); in ConcurrentSkipListSet() 349 public Comparator<? super E> comparator() { in comparator() method in ConcurrentSkipListSet 350 return m.comparator(); in comparator()
|
D | ConcurrentSkipListMap.java | 317 private final Comparator<? super K> comparator; field in ConcurrentSkipListMap 631 if (comparator != null) in comparable() 632 return new ComparableUsingComparator<K>((K)key, comparator); in comparable() 642 Comparator<? super K> cmp = comparator; in compare() 1354 this.comparator = null; in ConcurrentSkipListMap() 1366 public ConcurrentSkipListMap(Comparator<? super K> comparator) { in ConcurrentSkipListMap() argument 1367 this.comparator = comparator; in ConcurrentSkipListMap() 1383 this.comparator = null; in ConcurrentSkipListMap() 1398 this.comparator = m.comparator(); in ConcurrentSkipListMap() 1920 public Comparator<? super K> comparator() { in comparator() method in ConcurrentSkipListMap [all …]
|
/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/net/ |
D | HttpRetryExceptionTest.java | 35 private static final SerializableAssert comparator = new SerializableAssert() { field in HttpRetryExceptionTest 53 LOCATION), comparator); in testSerializationSelf() 61 100, LOCATION), comparator); in testSerializationCompatibility()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ |
D | RefSortedMap.java | 88 private final Comparator<? super K> comparator; field in RefSortedMap 166 public Comparator<? super K> comparator() { 167 return RefSortedMap.this.comparator(); 246 return comparator != null ? comparator.compare(start, end) 251 public RefSortedMap(Comparator<? super K> comparator) { 252 this.comparator = comparator; 262 this(map.comparator()); 266 public Comparator<? super K> comparator() { 267 return comparator;
|
D | PriorityQueueTest.java | 197 assertNull(queue.comparator()); in test_Constructor() 207 assertNull(queue.comparator()); in test_ConstructorI() 218 assertNull(queue.comparator()); in test_ConstructorILjava_util_Comparator() 220 MockComparator<Object> comparator = new MockComparator<Object>(); in test_ConstructorILjava_util_Comparator() local 221 queue = new PriorityQueue<Object>(100, comparator); in test_ConstructorILjava_util_Comparator() 224 assertEquals(comparator, queue.comparator()); in test_ConstructorILjava_util_Comparator() 255 assertEquals(objectComparator, integerQueue.comparator()); in test_ConstructorILjava_util_Comparator_cast() 271 assertNull(integerQueue.comparator()); in test_ConstructorLjava_util_Colleciton() 321 assertEquals(queue.comparator(), constructedQueue.comparator()); in test_ConstructorLjava_util_Colleciton_from_priorityqueue() 339 assertEquals(treeSet.comparator(), queue.comparator()); in test_ConstructorLjava_util_Colleciton_from_sortedset() [all …]
|
D | HashSetTest.java | 212 SerializationTest.verifySelf(hs, comparator); in test_Serialization() 213 SerializationTest.verifyGolden(this, hs, comparator); in test_Serialization() 243 private static final SerializationTest.SerializableAssert comparator = new field in HashSetTest
|
D | SortedMapTestBase.java | 183 assertEquals(ref.comparator(), map.comparator()); in testComparator() 208 if (ref.comparator() != null && in testSubMap() 209 ref.comparator().compare(key0, key1) > 0) { in testSubMap() 219 if (ref.comparator() != null && ref.comparator().compare(100, 0) < 0) { in testSubMap()
|
D | RandomTest.java | 305 SerializationTest.verifyGolden(this, rand, comparator); in testSerializationCompatibility() 309 SerializationTest.verifySelf(rand, comparator); in testSerializationCompatibility() 312 public static final SerializationTest.SerializableAssert comparator = field in RandomTest
|
D | Collections2Test.java | 45 private static final SerializableAssert comparator = new SerializableAssert() { field in Collections2Test 397 SerializationTest.verifySelf(Collections.EMPTY_LIST, comparator); in test_EmptyList_readResolve() 404 SerializationTest.verifySelf(Collections.EMPTY_MAP, comparator); in test_EmptyMap_readResolve() 411 SerializationTest.verifySelf(Collections.EMPTY_SET, comparator); in test_EmptySet_readResolve()
|
D | TreeSetTest.java | 98 .comparator() == comp); in test_ConstructorLjava_util_SortedSet() 160 myTreeSet.comparator() == comp); in test_comparator()
|
/libcore/support/src/test/java/org/apache/harmony/testframework/serialization/ |
D | SerializationTest.java | 319 public static void verifyGolden(TestCase test, Object object, SerializableAssert comparator) in verifyGolden() argument 321 assertNotNull("Null comparator", comparator); in verifyGolden() 323 comparator.assertDeserialized((Serializable) object, deserialized); in verifyGolden() 356 public static void verifyGolden(TestCase test, Object[] objects, SerializableAssert comparator) in verifyGolden() argument 361 comparator.assertDeserialized((Serializable) objects[i], deserialized); in verifyGolden() 386 public static void verifySelf(Object object, SerializableAssert comparator) throws Exception { in verifySelf() argument 388 comparator.assertDeserialized(initial, copySerializable(initial)); in verifySelf() 415 public static void verifySelf(Object[] objects, SerializableAssert comparator) in verifySelf() argument 419 verifySelf(entry, comparator); in verifySelf()
|
/libcore/luni/src/main/java/libcore/util/ |
D | CollectionUtils.java | 85 public static <T> void removeDuplicates(List<T> list, Comparator<? super T> comparator) { 86 Collections.sort(list, comparator); 89 if (comparator.compare(list.get(j - 1), list.get(i)) != 0) {
|
/libcore/luni/src/test/java/libcore/java/util/ |
D | TreeSetTest.java | 44 assertEquals(0, deserialized.comparator().compare("X", "x")); in testSerializationWithComparator() 132 assertEquals(0, deserialized.comparator().compare("X", "x")); in testJava5SerializationWithComparator()
|
D | OldPriorityQueueTest.java | 31 assertNull(queue.comparator()); in test_ConstructorI()
|
D | TreeMapTest.java | 182 assertEquals(null, copy.comparator()); in testMapConstructorPassingSortedMap() 289 assertEquals(0, deserialized.comparator().compare("X", "x")); in testSerializationWithComparator() 398 assertEquals(0, deserialized.comparator().compare("X", "x")); in testJava5SerializationWithComparator()
|
D | OldCollectionsTest.java | 46 private static final SerializableAssert comparator = new SerializableAssert() { field in OldCollectionsTest 586 SerializationTest.verifySelf(Collections.EMPTY_LIST, comparator); in test_EmptyList_readResolve() 593 SerializationTest.verifySelf(Collections.EMPTY_MAP, comparator); in test_EmptyMap_readResolve() 600 SerializationTest.verifySelf(Collections.EMPTY_SET, comparator); in test_EmptySet_readResolve()
|
D | OldTreeMapTest.java | 95 .comparator() == comp); in test_ConstructorLjava_util_Comparator() 141 anotherTreeMap.comparator() == comp); in test_ConstructorLjava_util_SortedMap()
|