| Package | Description |
|---|---|
| java.lang | |
| java.util |
| Modifier and Type | Field and Description |
|---|---|
static Comparator<String> |
String.CASE_INSENSITIVE_ORDER |
| Modifier and Type | Method and Description |
|---|---|
Comparator<? super E> |
TreeSet.comparator()
Returns the comparator used to compare elements in this
TreeSet. |
Comparator<? super K> |
TreeMap.comparator()
Returns the comparator used to compare elements in this map.
|
Comparator<? super E> |
SortedSet.comparator()
Returns the comparator used to compare elements in this
SortedSet. |
Comparator<? super K> |
SortedMap.comparator()
Returns the comparator used to compare keys in this sorted map.
|
Comparator<? super E> |
PriorityQueue.comparator()
Gets the comparator of the priority queue.
|
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 a
Comparator that reverses the order of the
Comparator passed. |
| Modifier and Type | Method and Description |
|---|---|
static <T> int |
Collections.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> int |
Arrays.binarySearch(T[] array,
int startIndex,
int endIndex,
T object,
Comparator<? super T> comparator)
Performs a binary search for the specified element in a part of the
specified sorted array using the Comparator to compare elements.
|
static <T> int |
Arrays.binarySearch(T[] array,
T object,
Comparator<? super T> comparator)
Performs a binary search for the specified element in the specified
sorted array using the Comparator to compare elements.
|
static <T> int |
Objects.compare(T a,
T b,
Comparator<? super T> c) |
static <T> T |
Collections.max(Collection<? extends T> collection,
Comparator<? super T> comparator)
Searches the specified collection for the maximum element using the
specified comparator.
|
static <T> T |
Collections.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 a
Comparator that reverses the order of the
Comparator passed. |
static <T> void |
Collections.sort(List<T> list,
Comparator<? super T> comparator)
Sorts the specified list using the specified comparator.
|
static <T> void |
Arrays.sort(T[] array,
Comparator<? super T> comparator)
Sorts the specified array using the specified
Comparator. |
static <T> void |
Arrays.sort(T[] array,
int start,
int end,
Comparator<? super T> comparator)
Sorts the specified range in the array using the specified
Comparator. |
| Constructor and Description |
|---|
PriorityQueue(int initialCapacity,
Comparator<? super E> comparator)
Constructs a priority queue with the specified capacity and comparator.
|
TreeMap(Comparator<? super K> comparator)
Constructs a new empty
TreeMap instance with the specified
comparator. |
TreeSet(Comparator<? super E> comparator)
Constructs a new empty instance of
TreeSet which uses the
specified comparator. |
Copyright © 2024. All rights reserved.