Searched refs:comparator (Results 1 - 22 of 22) sorted by relevance

/libcore/luni/src/main/java/java/util/
H A DSortedSet.java34 * Returns the comparator used to compare elements in this {@code SortedSet}.
36 * @return a comparator or null if the natural ordering is used.
38 public Comparator<? super E> comparator(); method in interface:SortedSet
H A DSortedMap.java23 * natural ordering of its keys or the ordering given by a specified comparator.
28 * Returns the comparator used to compare keys in this sorted map.
30 * @return the comparator or {@code null} if the natural order is used.
32 public Comparator<? super K> comparator(); method in interface:SortedMap
H A DPriorityQueue.java25 * according to their natural order or according to the comparator specified at
47 private Comparator<? super E> comparator; field in class:PriorityQueue
73 * Constructs a priority queue with the specified capacity and comparator.
77 * @param comparator
78 * the specified comparator. If it is null, the natural ordering
83 public PriorityQueue(int initialCapacity, Comparator<? super E> comparator) { argument
88 this.comparator = comparator;
120 * comparator.
133 * size of the sorted set. The priority queue will have the same comparator
229 public Comparator<? super E> comparator() { method in class:PriorityQueue
[all...]
H A DTreeSet.java73 * specified comparator.
75 * @param comparator
76 * the comparator to use.
78 public TreeSet(Comparator<? super E> comparator) { argument
79 backingMap = new TreeMap<E, Object>(comparator);
90 this(set.comparator());
108 * when the object is null and the comparator cannot handle
127 * when an object in the collection is null and the comparator
147 * Returns a new {@code TreeSet} with the same elements, size and comparator
171 * Returns the comparator use
175 public Comparator<? super E> comparator() { method in class:TreeSet
[all...]
H A DTreeMap.java33 * <p>This map sorts keys using either a user-supplied comparator or the key's
37 * this map. If a user-supplied comparator is in use, it will be returned
38 * by {@link #comparator}.
39 * <li>If no user-supplied comparator is supplied, keys will be sorted by
43 * this map. In this case {@link #comparator} will return null.
45 * With either a comparator or a natural ordering, comparisons should be
76 Comparator<? super K> comparator; field in class:TreeMap
87 this.comparator = (Comparator<? super K>) NATURAL_ORDER;
101 * = new TreeMap<String, Integer>(copyFrom.comparator());
113 * Create a tree map ordered by {@code comparator}
120 TreeMap(Comparator<? super K> comparator) argument
671 public Comparator<? super K> comparator() { method in class:TreeMap
984 public Comparator<? super K> comparator() { method in class:TreeMap.KeySet
1366 public Comparator<? super K> comparator() { method in class:TreeMap.BoundedMap
1606 public Comparator<? super K> comparator() { method in class:TreeMap.BoundedMap.BoundedKeySet
[all...]
H A DCollections.java205 ReverseComparator2(Comparator<T> comparator) { argument
206 this.cmp = comparator;
813 @Override public Comparator<? super K> comparator() { method in class:Collections.SynchronizedSortedMap
815 return sm.comparator();
874 @Override public Comparator<? super E> comparator() { method in class:Collections.SynchronizedSortedSet
876 return ss.comparator();
1332 @Override public Comparator<? super K> comparator() { method in class:Collections.UnmodifiableSortedMap
1333 return sm.comparator();
1368 @Override public Comparator<? super E> comparator() { method in class:Collections.UnmodifiableSortedSet
1369 return ss.comparator();
1471 binarySearch(List<? extends T> list, T object, Comparator<? super T> comparator) argument
1617 max(Collection<? extends T> collection, Comparator<? super T> comparator) argument
1673 min(Collection<? extends T> collection, Comparator<? super T> comparator) argument
1889 sort(List<T> list, Comparator<? super T> comparator) argument
3339 @Override public Comparator<? super E> comparator() { method in class:Collections.CheckedSortedSet
3378 @Override public Comparator<? super K> comparator() { method in class:Collections.CheckedSortedMap
[all...]
H A DArrays.java538 * using {@code comparator} to compare elements.
544 * @param comparator the {@code Comparator} used to compare the elements.
551 public static <T> int binarySearch(T[] array, T value, Comparator<? super T> comparator) { argument
552 return binarySearch(array, 0, array.length, value, comparator);
558 * using {@code comparator} to compare elements.
566 * @param comparator the {@code Comparator} used to compare the elements.
577 Comparator<? super T> comparator) {
578 if (comparator == null) {
588 int midValCmp = comparator.compare(array[mid], value);
1931 * comparator tha
576 binarySearch(T[] array, int startIndex, int endIndex, T value, Comparator<? super T> comparator) argument
2021 sort(T[] array, int start, int end, Comparator<? super T> comparator) argument
2037 sort(T[] array, Comparator<? super T> comparator) argument
[all...]
/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/net/
H A DHttpRetryExceptionTest.java34 // comparator for HttpRetryException objects
35 private static final SerializableAssert comparator = new SerializableAssert() { field in class:HttpRetryExceptionTest
53 LOCATION), comparator);
61 100, LOCATION), comparator);
/libcore/luni/src/main/java/libcore/util/
H A DCollectionUtils.java83 * not use {@link Object#equals}: only the comparator defines equality.
85 public static <T> void removeDuplicates(List<T> list, Comparator<? super T> comparator) { argument
86 Collections.sort(list, comparator);
89 if (comparator.compare(list.get(j - 1), list.get(i)) != 0) {
/libcore/luni/src/main/java/java/util/concurrent/
H A DPriorityBlockingQueue.java104 * priority queue is ordered by comparator, or by the elements'
105 * natural ordering, if comparator is null: For each node n in the
117 * The comparator, or null if priority queue uses elements'
120 private transient Comparator<? super E> comparator; field in class:PriorityBlockingQueue
169 * comparator.
172 * @param comparator the comparator that will be used to order this
179 Comparator<? super E> comparator) {
184 this.comparator = comparator;
178 PriorityBlockingQueue(int initialCapacity, Comparator<? super E> comparator) argument
545 public Comparator<? super E> comparator() { method in class:PriorityBlockingQueue
[all...]
H A DConcurrentSkipListSet.java78 * the specified comparator.
80 * @param comparator the comparator that will be used to order this set.
84 public ConcurrentSkipListSet(Comparator<? super E> comparator) { argument
85 m = new ConcurrentSkipListMap<E,Object>(comparator);
113 m = new ConcurrentSkipListMap<E,Object>(s.comparator());
349 public Comparator<? super E> comparator() { method in class:ConcurrentSkipListSet
350 return m.comparator();
434 * <tt>{@link Collections#reverseOrder(Comparator) Collections.reverseOrder}(comparator())</tt>.
H A DConcurrentSkipListMap.java312 * The comparator used to maintain order in this map, or null
316 private final Comparator<? super K> comparator; field in class:ConcurrentSkipListMap
336 * (Note that comparator must be separately initialized.)
595 * Represents a key with a comparator as a Comparable.
600 * per-comparison whether to use comparator or comparable because
622 * If using comparator, return a ComparableUsingComparator, else
630 if (comparator != null)
631 return new ComparableUsingComparator<K>((K)key, comparator);
637 * Compares using comparator or natural ordering. Used when the
641 Comparator<? super K> cmp = comparator;
1365 ConcurrentSkipListMap(Comparator<? super K> comparator) argument
1921 public Comparator<? super K> comparator() { method in class:ConcurrentSkipListMap
2290 public Comparator<? super E> comparator() { return m.comparator(); } method in class:ConcurrentSkipListMap.KeySet
2783 public Comparator<? super K> comparator() { method in class:ConcurrentSkipListMap.SubMap
[all...]
/libcore/support/src/test/java/org/apache/harmony/testframework/serialization/
H A DSerializationTest.java186 // default comparator for a class that has equals(Object) method
253 * Returns <code>comparator</code> for provided serializable
256 * The <code>comparator</code> is searched in the following order: <br>
258 * selected as </code>comparator</code>.<br>- if passed <code>object</code>
268 * @return object's comparator
280 // use default comparator
284 // TODO use generics to detect comparator
292 throw new RuntimeException("Failed to detect comparator");
314 * <code>object</code> using specified <code>comparator</code>.
318 * @param comparator
320 verifyGolden(TestCase test, Object object, SerializableAssert comparator) argument
357 verifyGolden(TestCase test, Object[] objects, SerializableAssert comparator) argument
387 verifySelf(Object object, SerializableAssert comparator) argument
416 verifySelf(Object[] objects, SerializableAssert comparator) argument
[all...]
/libcore/luni/src/test/java/libcore/java/util/
H A DTreeSetTest.java44 assertEquals(0, deserialized.comparator().compare("X", "x"));
104 * comparator. http://b/5552608
132 assertEquals(0, deserialized.comparator().compare("X", "x"));
H A DOldPriorityQueueTest.java31 assertNull(queue.comparator());
49 // Even though "BB" is equivalent to "AA" using the string length comparator, remove()
H A DTreeMapTest.java169 * Test that entry set contains and removal use the comparator rather than equals.
182 assertEquals(null, copy.comparator());
289 assertEquals(0, deserialized.comparator().compare("X", "x"));
398 assertEquals(0, deserialized.comparator().compare("X", "x"));
H A DOldCollectionsTest.java46 private static final SerializableAssert comparator = new SerializableAssert() { field in class:OldCollectionsTest
312 assertNotNull("Assert 0: comparator must not be null", roc);
314 assertTrue("Assert 1: comparator must implement Serializable",
330 assertNotNull("Assert 0: comparator must not be null", roc);
332 assertTrue("Assert 1: comparator must implement Serializable",
342 assertNotNull("Assert 3: comparator must not be null", roc);
344 assertTrue("Assert 4: comparator must implement Serializable",
586 SerializationTest.verifySelf(Collections.EMPTY_LIST, comparator);
593 SerializationTest.verifySelf(Collections.EMPTY_MAP, comparator);
600 SerializationTest.verifySelf(Collections.EMPTY_SET, comparator);
[all...]
H A DOldTreeMapTest.java94 assertTrue("TreeMap answered incorrect comparator", reversedTreeMap
95 .comparator() == comp);
98 assertTrue("TreeMap does not use comparator (firstKey was incorrect)",
100 assertTrue("TreeMap does not use comparator (lastKey was incorrect)",
140 assertTrue("New tree map does not answer correct comparator",
141 anotherTreeMap.comparator() == comp);
142 assertTrue("TreeMap does not use comparator (firstKey was incorrect)",
144 assertTrue("TreeMap does not use comparator (lastKey was incorrect)",
/libcore/luni/src/test/java/tests/api/java/util/
H A DHashSetTest.java212 SerializationTest.verifySelf(hs, comparator);
213 SerializationTest.verifyGolden(this, hs, comparator);
243 private static final SerializationTest.SerializableAssert comparator = new field in class:HashSetTest
H A DIdentityHashMapTest.java450 SerializationTest.verifySelf(map, comparator);
451 SerializationTest.verifyGolden(this, map, comparator);
484 private static final SerializationTest.SerializableAssert comparator = new field in class:IdentityHashMapTest
/libcore/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/
H A DPatternTest.java784 SerializableAssert comparator = new SerializableAssert() {
791 SerializationTest.verifyGolden(this, pat, comparator);
792 SerializationTest.verifySelf(pat, comparator);
/libcore/support/src/test/java/tests/resources/
H A Djunit4-4.3.1.jarMETA-INF/ META-INF/MANIFEST.MF junit/ junit/extensions/ junit/framework/ junit/runner/ junit/textui/ org/ ...

Completed in 435 milliseconds