Home
last modified time | relevance | path

Searched refs:Comparator (Results 1 – 25 of 142) sorted by relevance

123456

/libcore/luni/src/test/java/libcore/java/util/
DComparatorTest.java22 import java.util.Comparator;
48 private <T> void checkComparison(Comparator<T> comparator, List<T> items) { in checkComparison()
60 Comparator<Item> comparator = Comparator.comparingDouble(Item::getOrderAsDouble); in testComparingDouble()
65 Comparator<Item> comparator = Comparator.comparingInt(Item::getOrderAsInt); in testComparingInt()
70 Comparator<Item> comparator = Comparator.comparingLong(Item::getOrderAsLong); in testComparingLong()
75 Comparator<Item> comparator = Comparator.comparing(Item::getOrderAsString); in testComparing()
80 Comparator<Item> comparator = Comparator.comparing(Item::getOrderAsString, in testComparing2()
86 Comparator<Item> comparator = Comparator.naturalOrder(); in testNaturalOrder()
95 Comparator<Item> comparator = Comparator.reverseOrder(); in testReverseOrder()
100 Comparator<Item> revComparator = Comparator.reverseOrder(); in testReverse()
[all …]
DTimSortTest.java21 import java.util.Comparator;
29 private static final Comparator<Integer> NATURAL_ORDER_COMPARATOR = new Comparator<Integer>() {
DOldPriorityQueueTest.java20 import java.util.Comparator;
85 Comparator<String> {
101 private static class MockComparatorCast<E> implements Comparator<E> {
/libcore/ojluni/src/main/java/java/util/
DComparator.java109 public interface Comparator<T> { interface
184 default Comparator<T> reversed() { in reversed()
213 default Comparator<T> thenComparing(Comparator<? super T> other) { in thenComparing()
215 return (Comparator<T> & Serializable) (c1, c2) -> { in thenComparing()
238 default <U> Comparator<T> thenComparing( in thenComparing()
240 Comparator<? super U> keyComparator) in thenComparing()
262 default <U extends Comparable<? super U>> Comparator<T> thenComparing( in thenComparing()
283 default Comparator<T> thenComparingInt(ToIntFunction<? super T> keyExtractor) { in thenComparingInt()
302 default Comparator<T> thenComparingLong(ToLongFunction<? super T> keyExtractor) { in thenComparingLong()
321 default Comparator<T> thenComparingDouble(ToDoubleFunction<? super T> keyExtractor) { in thenComparingDouble()
[all …]
DComparators.java47 enum NaturalOrderComparator implements Comparator<Comparable<Object>> {
56 public Comparator<Comparable<Object>> reversed() { in reversed()
57 return Comparator.reverseOrder(); in reversed()
64 final static class NullComparator<T> implements Comparator<T>, Serializable {
68 private final Comparator<T> real;
71 NullComparator(boolean nullFirst, Comparator<? super T> real) { in NullComparator()
73 this.real = (Comparator<T>) real; in NullComparator()
88 public Comparator<T> thenComparing(Comparator<? super T> other) { in thenComparing()
94 public Comparator<T> reversed() { in reversed()
DTreeSet.java140 public TreeSet(Comparator<? super E> comparator) { in TreeSet()
305 Comparator<?> cc = set.comparator(); in addAll()
306 Comparator<? super E> mc = map.comparator(); in addAll()
386 public Comparator<? super E> comparator() { in comparator()
524 Comparator<? super E> c = (Comparator<? super E>) s.readObject(); in readObject()
DSortedSet.java118 Comparator<? super E> comparator(); in comparator()
259 public Comparator<? super E> getComparator() { in spliterator()
DMap.java498 … public static <K extends Comparable<? super K>, V> Comparator<Map.Entry<K, V>> comparingByKey() { in comparingByKey()
499 return (Comparator<Map.Entry<K, V>> & Serializable) in comparingByKey()
515 …public static <K, V extends Comparable<? super V>> Comparator<Map.Entry<K, V>> comparingByValue() { in comparingByValue()
516 return (Comparator<Map.Entry<K, V>> & Serializable) in comparingByValue()
533 public static <K, V> Comparator<Map.Entry<K, V>> comparingByKey(Comparator<? super K> cmp) { in comparingByKey()
535 return (Comparator<Map.Entry<K, V>> & Serializable) in comparingByKey()
552 … public static <K, V> Comparator<Map.Entry<K, V>> comparingByValue(Comparator<? super V> cmp) { in comparingByValue()
554 return (Comparator<Map.Entry<K, V>> & Serializable) in comparingByValue()
DPriorityQueue.java108 private final Comparator<? super E> comparator;
147 public PriorityQueue(Comparator<? super E> comparator) { in PriorityQueue()
163 Comparator<? super E> comparator) { in PriorityQueue()
192 this.comparator = (Comparator<? super E>) ss.comparator(); in PriorityQueue()
197 this.comparator = (Comparator<? super E>) pq.comparator(); in PriorityQueue()
222 this.comparator = (Comparator<? super E>) c.comparator(); in PriorityQueue()
241 this.comparator = (Comparator<? super E>) c.comparator(); in PriorityQueue()
748 public Comparator<? super E> comparator() { in comparator()
/libcore/ojluni/annotations/hiddenapi/sun/security/x509/
DAVAComparator.java22 class AVAComparator implements java.util.Comparator<sun.security.x509.AVA> {
28 static java.util.Comparator<sun.security.x509.AVA> getInstance() { in getInstance()
37 private static final java.util.Comparator<sun.security.x509.AVA> INSTANCE;
/libcore/ojluni/src/main/java/java/util/function/
DBinaryOperator.java28 import java.util.Comparator;
57 public static <T> BinaryOperator<T> minBy(Comparator<? super T> comparator) { in minBy()
72 public static <T> BinaryOperator<T> maxBy(Comparator<? super T> comparator) { in maxBy()
/libcore/luni/src/test/java/libcore/java/util/function/
DBinaryOperatorTest.java21 import java.util.Comparator;
27 Comparator<String> stringComparator = String::compareTo; in testMinBy()
39 Comparator<String> stringComparator = String::compareTo; in testMaxBy()
/libcore/ojluni/src/main/java/sun/misc/
DASCIICaseInsensitiveComparator.java28 import java.util.Comparator;
36 public class ASCIICaseInsensitiveComparator implements Comparator<String> {
37 public static final Comparator<String> CASE_INSENSITIVE_ORDER =
/libcore/ojluni/src/main/java/sun/security/util/
DByteArrayTagOrder.java36 import java.util.Comparator;
38 public class ByteArrayTagOrder implements Comparator<byte[]> {
DByteArrayLexOrder.java29 import java.util.Comparator;
36 public class ByteArrayLexOrder implements Comparator<byte[]> {
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DRefSortedMap.java28 import java.util.Comparator;
88 private final Comparator<? super K> comparator;
166 public Comparator<? super K> comparator() {
241 this((Comparator<? super K>) null);
251 public RefSortedMap(Comparator<? super K> comparator) {
266 public Comparator<? super K> comparator() {
355 transient private Comparator<MapEntry<K, V>> cmp = createCmp();
357 Comparator<MapEntry<K, V>> createCmp() {
358 return new Comparator<MapEntry<K, V>>() {
DArrays2Test.java23 import java.util.Comparator;
397 assertEquals(2, Arrays.binarySearch(strings, "a", (Comparator<String>) null)); in test_binarySearch$TTLjava_util_ComparatorsuperT()
398 assertEquals(-1, Arrays.binarySearch(strings, "A", (Comparator<String>) null)); in test_binarySearch$TTLjava_util_ComparatorsuperT()
399 assertEquals(-4, Arrays.binarySearch(strings, "b", (Comparator<String>) null)); in test_binarySearch$TTLjava_util_ComparatorsuperT()
400 assertEquals(0, Arrays.binarySearch(strings, "B", (Comparator<String>) null)); in test_binarySearch$TTLjava_util_ComparatorsuperT()
401 assertEquals(3, Arrays.binarySearch(strings, "c", (Comparator<String>) null)); in test_binarySearch$TTLjava_util_ComparatorsuperT()
402 assertEquals(-2, Arrays.binarySearch(strings, "C", (Comparator<String>) null)); in test_binarySearch$TTLjava_util_ComparatorsuperT()
403 assertEquals(-5, Arrays.binarySearch(strings, "d", (Comparator<String>) null)); in test_binarySearch$TTLjava_util_ComparatorsuperT()
404 assertEquals(1, Arrays.binarySearch(strings, "D", (Comparator<String>) null)); in test_binarySearch$TTLjava_util_ComparatorsuperT()
422 Arrays.binarySearch(strings, (String) null, (Comparator<String>) null); in test_binarySearch$TTLjava_util_ComparatorsuperT()
/libcore/ojluni/src/main/java/java/util/concurrent/
DConcurrentSkipListMap.java45 import java.util.Comparator;
375 final Comparator<? super K> comparator;
649 static final int cpr(Comparator c, Object x, Object y) { in cpr()
663 private Node<K,V> findPredecessor(Object key, Comparator<? super K> cmp) { in findPredecessor()
738 Comparator<? super K> cmp = comparator; in findNode()
774 Comparator<? super K> cmp = comparator; in doGet()
816 Comparator<? super K> cmp = comparator; in doPut()
953 Comparator<? super K> cmp = comparator; in doRemove()
1225 final Node<K,V> findNear(K key, int rel, Comparator<? super K> cmp) { in findNear()
1261 Comparator<? super K> cmp = comparator; in getNear()
[all …]
DPriorityBlockingQueue.java41 import java.util.Comparator;
161 private transient Comparator<? super E> comparator;
220 Comparator<? super E> comparator) { in PriorityBlockingQueue()
252 this.comparator = (Comparator<? super E>) ss.comparator(); in PriorityBlockingQueue()
258 this.comparator = (Comparator<? super E>) pq.comparator(); in PriorityBlockingQueue()
330 Comparator<? super E> cmp = comparator; in dequeue()
369 Comparator<? super T> cmp) { in siftUpUsingComparator()
414 Comparator<? super T> cmp) { in siftDownUsingComparator()
440 Comparator<? super E> cmp = comparator; in heapify()
486 Comparator<? super E> cmp = comparator; in offer()
[all …]
/libcore/ojluni/src/main/java/java/util/stream/
DSortedOps.java29 import java.util.Comparator;
62 Comparator<? super T> comparator) { in makeRef()
104 private final Comparator<? super T> comparator;
116 Comparator<? super T> comp = (Comparator<? super T>) Comparator.naturalOrder(); in OfRef()
125 OfRef(AbstractPipeline<?, T, ?> upstream, Comparator<? super T> comparator) { in OfRef()
305 protected final Comparator<? super T> comparator;
309 AbstractRefSortingSink(Sink<? super T> downstream, Comparator<? super T> comparator) { in AbstractRefSortingSink()
334 SizedRefSortingSink(Sink<? super T> sink, Comparator<? super T> comparator) { in SizedRefSortingSink()
374 RefSortingSink(Sink<? super T> sink, Comparator<? super T> comparator) { in RefSortingSink()
/libcore/benchmarks/src/benchmarks/regression/
DCollectionsBenchmark.java22 import java.util.Comparator;
31 public static Comparator<Integer> REVERSE = new Comparator<Integer>() {
/libcore/ojluni/annotations/hiddenapi/sun/misc/
DASCIICaseInsensitiveComparator.java29 public class ASCIICaseInsensitiveComparator implements java.util.Comparator<java.lang.String> {
61 public static final java.util.Comparator<java.lang.String> CASE_INSENSITIVE_ORDER;
/libcore/ojluni/annotations/hiddenapi/java/util/concurrent/
DPriorityBlockingQueue.java52 public PriorityBlockingQueue(int initialCapacity, java.util.Comparator<? super E> comparator) { in PriorityBlockingQueue()
74 int k, T x, java.lang.Object[] array, java.util.Comparator<? super T> cmp) { in siftUpUsingComparator()
83 int k, T x, java.lang.Object[] array, int n, java.util.Comparator<? super T> cmp) { in siftDownUsingComparator()
124 public java.util.Comparator<? super E> comparator() { in comparator()
215 private transient java.util.Comparator<? super E> comparator;
/libcore/ojluni/annotations/hiddenapi/java/util/
DPriorityQueue.java41 public PriorityQueue(java.util.Comparator<? super E> comparator) { in PriorityQueue()
45 public PriorityQueue(int initialCapacity, java.util.Comparator<? super E> comparator) { in PriorityQueue()
165 public java.util.Comparator<? super E> comparator() { in comparator()
186 private final java.util.Comparator<? super E> comparator;
/libcore/ojluni/src/main/java/java/lang/reflect/
DMethod.java32 import java.util.Comparator;
67 public static final Comparator<Method> ORDER_BY_SIGNATURE = new Comparator<Method>() {

123456