Uses of Interface
java.util.Comparator
| Package | Description |
|---|---|
| java.lang | |
| java.lang.reflect | |
| java.text | |
| java.util | |
| java.util.concurrent |
Utility classes commonly useful in concurrent programming.
|
| libcore.util | |
| org.apache.commons.codec |
A small set of interfaces used by
the various implementations in the sub-packages.
|
| org.apache.harmony.security.x501 | |
| org.apache.http.cookie |
The API for client-side state management via cookies,
commonly referred to as HttpCookie.
|
-
Uses of Comparator in java.lang
Fields in java.lang declared as Comparator Modifier and Type Field Description static Comparator<String>String. CASE_INSENSITIVE_ORDERA comparator ignoring the case of the characters. -
Uses of Comparator in java.lang.reflect
Fields in java.lang.reflect declared as Comparator Modifier and Type Field Description static Comparator<Field>Field. ORDER_BY_NAME_AND_DECLARING_CLASSOrders fields by their name and declaring class.static Comparator<Method>Method. ORDER_BY_SIGNATUREOrders methods by their name, parameters and return type. -
Uses of Comparator in java.text
Classes in java.text that implement Comparator Modifier and Type Class Description classCollatorPerforms locale-sensitive string comparison.classRuleBasedCollatorA concrete implementation class forCollation. -
Uses of Comparator in java.util
Methods in java.util that return Comparator Modifier and Type Method Description Comparator<? super E>PriorityQueue. comparator()Gets the comparator of the priority queue.Comparator<? super K>SortedMap. comparator()Returns the comparator used to compare keys in this sorted map, or null if the natural ordering is in use.Comparator<? super E>SortedSet. comparator()Returns the comparator used to compare elements in thisSortedSet.Comparator<? super K>TreeMap. comparator()Comparator<? super E>TreeSet. comparator()Returns the comparator used to compare elements in thisTreeSet.static <T> Comparator<T>Collections. reverseOrder()A comparator which reverses the natural order of the elements.static <T> Comparator<T>Collections. reverseOrder(Comparator<T> c)Returns aComparatorthat reverses the order of theComparatorpassed.Methods in java.util with parameters of type Comparator Modifier and Type Method Description static <T> intArrays. binarySearch(T[] array, int startIndex, int endIndex, T value, Comparator<? super T> comparator)Performs a binary search forvaluein the ascending sorted arrayarray, in the range specified by fromIndex (inclusive) and toIndex (exclusive), usingcomparatorto compare elements.static <T> intArrays. binarySearch(T[] array, T value, Comparator<? super T> comparator)Performs a binary search forvaluein the ascending sorted arrayarray, usingcomparatorto compare elements.static <T> intCollections. binarySearch(List<? extends T> list, T object, Comparator<? super T> comparator)Performs a binary search for the specified element in the specified sorted list using the specified comparator.static <T> intObjects. compare(T a, T b, Comparator<? super T> c)Returns 0 ifa == b, orc.compare(a, b)otherwise.static <T> TCollections. max(Collection<? extends T> collection, Comparator<? super T> comparator)Searches the specified collection for the maximum element using the specified comparator.static <T> TCollections. min(Collection<? extends T> collection, Comparator<? super T> comparator)Searches the specified collection for the minimum element using the specified comparator.static <T> Comparator<T>Collections. reverseOrder(Comparator<T> c)Returns aComparatorthat reverses the order of theComparatorpassed.static <T> voidArrays. sort(T[] array, int start, int end, Comparator<? super T> comparator)Sorts the specified range in the array using the specifiedComparator.static <T> voidArrays. sort(T[] array, Comparator<? super T> comparator)Sorts the specified array using the specifiedComparator.static <T> voidCollections. sort(List<T> list, Comparator<? super T> comparator)Sorts the given list using the given comparator.Constructors in java.util with parameters of type Comparator Constructor Description PriorityQueue(int initialCapacity, Comparator<? super E> comparator)Constructs a priority queue with the specified capacity and comparator.TreeMap(Comparator<? super K> comparator)Create a tree map ordered bycomparator.TreeSet(Comparator<? super E> comparator)Constructs a new empty instance ofTreeSetwhich uses the specified comparator. -
Uses of Comparator in java.util.concurrent
Methods in java.util.concurrent that return Comparator Modifier and Type Method Description Comparator<? super K>ConcurrentSkipListMap. comparator()Comparator<? super E>ConcurrentSkipListSet. comparator()Comparator<? super E>PriorityBlockingQueue. comparator()Returns the comparator used to order the elements in this queue, ornullif this queue uses the natural ordering of its elements.Constructors in java.util.concurrent with parameters of type Comparator Constructor Description ConcurrentSkipListMap(Comparator<? super K> comparator)Constructs a new, empty map, sorted according to the specified comparator.ConcurrentSkipListSet(Comparator<? super E> comparator)Constructs a new, empty set that orders its elements according to the specified comparator.PriorityBlockingQueue(int initialCapacity, Comparator<? super E> comparator)Creates aPriorityBlockingQueuewith the specified initial capacity that orders its elements according to the specified comparator. -
Uses of Comparator in libcore.util
Methods in libcore.util with parameters of type Comparator Modifier and Type Method Description static <T> voidCollectionUtils. removeDuplicates(List<T> list, Comparator<? super T> comparator)Sorts and removes duplicate elements fromlist. -
Uses of Comparator in org.apache.commons.codec
Classes in org.apache.commons.codec that implement Comparator Modifier and Type Class Description classStringEncoderComparatorStrings are comparable, and this comparator allows you to configure it with an instance of a class which implements StringEncoder. -
Uses of Comparator in org.apache.harmony.security.x501
Classes in org.apache.harmony.security.x501 that implement Comparator Modifier and Type Class Description classAttributeTypeAndValueComparatorAttributeTypeAndValue comparator -
Uses of Comparator in org.apache.http.cookie
Classes in org.apache.http.cookie that implement Comparator Modifier and Type Class Description classCookieIdentityComparatorThis cookie comparator can be used to compare identity of cookies.classCookiePathComparatorThis cookie comparator ensures that multiple cookies satisfying a common criteria are ordered in the Cookie header such that those with more specific Path attributes precede those with less specific.