public final class Comparators extends Object
| Modifier and Type | Method and Description |
|---|---|
static org.eclipse.collections.api.block.SerializableComparator<Collection<?>> |
ascendingCollectionSizeComparator() |
static <T> org.eclipse.collections.api.block.SerializableComparator<T> |
byBooleanFunction(org.eclipse.collections.api.block.function.primitive.BooleanFunction<T> function) |
static <T> org.eclipse.collections.api.block.SerializableComparator<T> |
byByteFunction(org.eclipse.collections.api.block.function.primitive.ByteFunction<T> function) |
static <T> org.eclipse.collections.api.block.SerializableComparator<T> |
byCharFunction(org.eclipse.collections.api.block.function.primitive.CharFunction<T> function) |
static <T> org.eclipse.collections.api.block.SerializableComparator<T> |
byDoubleFunction(org.eclipse.collections.api.block.function.primitive.DoubleFunction<T> function) |
static <T> org.eclipse.collections.api.block.SerializableComparator<org.eclipse.collections.api.tuple.Pair<T,?>> |
byFirstOfPair(Comparator<? super T> comparator)
Creates a comparator for pairs by using an existing comparator that only compares the first element of the pair
|
static <T> org.eclipse.collections.api.block.SerializableComparator<T> |
byFloatFunction(org.eclipse.collections.api.block.function.primitive.FloatFunction<T> function) |
static <T,V extends Comparable<? super V>> |
byFunction(org.eclipse.collections.api.block.function.Function<? super T,? extends V> function) |
static <T,V> org.eclipse.collections.api.block.SerializableComparator<T> |
byFunction(org.eclipse.collections.api.block.function.Function<? super T,? extends V> function,
Comparator<V> comparator) |
static <T> org.eclipse.collections.api.block.SerializableComparator<T> |
byIntFunction(org.eclipse.collections.api.block.function.primitive.IntFunction<T> function) |
static <T> org.eclipse.collections.api.block.SerializableComparator<T> |
byLongFunction(org.eclipse.collections.api.block.function.primitive.LongFunction<T> function) |
static <T> org.eclipse.collections.api.block.SerializableComparator<org.eclipse.collections.api.tuple.Pair<?,T>> |
bySecondOfPair(Comparator<? super T> comparator)
Creates a comparator for pairs by using an existing comparator that only compares the second element of the pair
|
static <T> org.eclipse.collections.api.block.SerializableComparator<T> |
byShortFunction(org.eclipse.collections.api.block.function.primitive.ShortFunction<T> function) |
static <T> org.eclipse.collections.api.block.SerializableComparator<T> |
chain(Comparator<T>... comparators) |
static org.eclipse.collections.api.block.SerializableComparator<Collection<?>> |
descendingCollectionSizeComparator() |
static <T,V extends Comparable<? super V>> |
fromFunctions(org.eclipse.collections.api.block.function.Function<? super T,? extends V> one) |
static <T,V1 extends Comparable<? super V1>,V2 extends Comparable<? super V2>> |
fromFunctions(org.eclipse.collections.api.block.function.Function<? super T,? extends V1> one,
org.eclipse.collections.api.block.function.Function<? super T,? extends V2> two) |
static <T,V1 extends Comparable<? super V1>,V2 extends Comparable<? super V2>,V3 extends Comparable<? super V3>> |
fromFunctions(org.eclipse.collections.api.block.function.Function<? super T,? extends V1> one,
org.eclipse.collections.api.block.function.Function<? super T,? extends V2> two,
org.eclipse.collections.api.block.function.Function<? super T,? extends V3> three) |
static <T> org.eclipse.collections.api.block.SerializableComparator<T> |
naturalOrder()
Uses the natural compareTo methods of the objects which will throw if there are any nulls.
|
static <T extends Comparable<T>> |
nullSafeCompare(T value1,
T value2) |
static boolean |
nullSafeEquals(Object value1,
Object value2) |
static <T> org.eclipse.collections.api.block.SerializableComparator<org.eclipse.collections.api.set.sorted.SortedSetIterable<T>> |
powerSet() |
static <T> org.eclipse.collections.api.block.SerializableComparator<T> |
reverse(Comparator<T> comparator) |
static <T> org.eclipse.collections.api.block.SerializableComparator<T> |
reverseNaturalOrder()
Uses the natural compareTo methods of the objects which will throw if there are any nulls.
|
static <T> org.eclipse.collections.api.block.SerializableComparator<T> |
safeNullsHigh(Comparator<T> notNullSafeComparator) |
static <T> org.eclipse.collections.api.block.SerializableComparator<T> |
safeNullsLow(Comparator<T> notNullSafeComparator) |
public static <T> org.eclipse.collections.api.block.SerializableComparator<T> naturalOrder()
public static <T> org.eclipse.collections.api.block.SerializableComparator<T> reverseNaturalOrder()
public static <T> org.eclipse.collections.api.block.SerializableComparator<T> reverse(Comparator<T> comparator)
comparator - original comparator whose order will be reversedpublic static <T> org.eclipse.collections.api.block.SerializableComparator<T> safeNullsLow(Comparator<T> notNullSafeComparator)
public static <T> org.eclipse.collections.api.block.SerializableComparator<T> safeNullsHigh(Comparator<T> notNullSafeComparator)
public static <T> org.eclipse.collections.api.block.SerializableComparator<T> chain(Comparator<T>... comparators)
public static <T,V extends Comparable<? super V>> org.eclipse.collections.api.block.SerializableComparator<T> fromFunctions(org.eclipse.collections.api.block.function.Function<? super T,? extends V> one)
public static <T,V1 extends Comparable<? super V1>,V2 extends Comparable<? super V2>> org.eclipse.collections.api.block.SerializableComparator<T> fromFunctions(org.eclipse.collections.api.block.function.Function<? super T,? extends V1> one, org.eclipse.collections.api.block.function.Function<? super T,? extends V2> two)
public static <T,V1 extends Comparable<? super V1>,V2 extends Comparable<? super V2>,V3 extends Comparable<? super V3>> org.eclipse.collections.api.block.SerializableComparator<T> fromFunctions(org.eclipse.collections.api.block.function.Function<? super T,? extends V1> one, org.eclipse.collections.api.block.function.Function<? super T,? extends V2> two, org.eclipse.collections.api.block.function.Function<? super T,? extends V3> three)
public static <T> org.eclipse.collections.api.block.SerializableComparator<org.eclipse.collections.api.set.sorted.SortedSetIterable<T>> powerSet()
public static org.eclipse.collections.api.block.SerializableComparator<Collection<?>> ascendingCollectionSizeComparator()
public static org.eclipse.collections.api.block.SerializableComparator<Collection<?>> descendingCollectionSizeComparator()
public static <T> org.eclipse.collections.api.block.SerializableComparator<org.eclipse.collections.api.tuple.Pair<T,?>> byFirstOfPair(Comparator<? super T> comparator)
comparator - original comparator that compares the first element of the pairpublic static <T> org.eclipse.collections.api.block.SerializableComparator<org.eclipse.collections.api.tuple.Pair<?,T>> bySecondOfPair(Comparator<? super T> comparator)
comparator - original comparator that compares the second element of the pairpublic static <T,V extends Comparable<? super V>> org.eclipse.collections.api.block.SerializableComparator<T> byFunction(org.eclipse.collections.api.block.function.Function<? super T,? extends V> function)
public static <T> org.eclipse.collections.api.block.SerializableComparator<T> byBooleanFunction(org.eclipse.collections.api.block.function.primitive.BooleanFunction<T> function)
public static <T> org.eclipse.collections.api.block.SerializableComparator<T> byByteFunction(org.eclipse.collections.api.block.function.primitive.ByteFunction<T> function)
public static <T> org.eclipse.collections.api.block.SerializableComparator<T> byCharFunction(org.eclipse.collections.api.block.function.primitive.CharFunction<T> function)
public static <T> org.eclipse.collections.api.block.SerializableComparator<T> byDoubleFunction(org.eclipse.collections.api.block.function.primitive.DoubleFunction<T> function)
public static <T> org.eclipse.collections.api.block.SerializableComparator<T> byFloatFunction(org.eclipse.collections.api.block.function.primitive.FloatFunction<T> function)
public static <T> org.eclipse.collections.api.block.SerializableComparator<T> byIntFunction(org.eclipse.collections.api.block.function.primitive.IntFunction<T> function)
public static <T> org.eclipse.collections.api.block.SerializableComparator<T> byLongFunction(org.eclipse.collections.api.block.function.primitive.LongFunction<T> function)
public static <T> org.eclipse.collections.api.block.SerializableComparator<T> byShortFunction(org.eclipse.collections.api.block.function.primitive.ShortFunction<T> function)
public static <T,V> org.eclipse.collections.api.block.SerializableComparator<T> byFunction(org.eclipse.collections.api.block.function.Function<? super T,? extends V> function,
Comparator<V> comparator)
public static <T extends Comparable<T>> int nullSafeCompare(T value1, T value2)
Copyright © 2004–2018. All rights reserved.