| Package | Description |
|---|---|
| java.lang |
Provides classes that are fundamental to the design of the Java programming language.
|
| java.text |
Provides classes and interfaces for handling text, dates, numbers, and messages in a manner independent of natural languages.
|
| java.time |
The main API for dates, times, instants, and durations.
|
| java.time.chrono |
Generic API for calendar systems other than the default ISO.
|
| java.util |
Contains the collections framework, legacy collection classes, event model, date and time facilities, internationalization, and miscellaneous utility classes (a string tokenizer, a random-number generator, and a bit array).
|
| java.util.concurrent |
Utility classes commonly useful in concurrent programming.
|
| java.util.function |
Functional interfaces provide target types for lambda expressions and method references.
|
| java.util.stream |
Classes to support functional-style operations on streams of elements, such as map-reduce transformations on collections.
|
| javax.swing |
Provides a set of "lightweight" (all-Java language) components that, to the maximum degree possible, work the same on all platforms.
|
| javax.swing.table |
Provides classes and interfaces for dealing with
javax.swing.JTable.
|
| Modifier and Type | Field and Description |
|---|---|
static Comparator |
String.CASE_INSENSITIVE_ORDER
A Comparator that orders
String objects as by
compareToIgnoreCase.
|
| Modifier and Type | Class and Description |
|---|---|
class |
Collator
The
Collator class performs locale-sensitive
String comparison.
|
class |
RuleBasedCollator
The
RuleBasedCollator class is a concrete subclass of
Collator that provides a simple, data-driven, table collator.
|
| Modifier and Type | Method and Description |
|---|---|
static Comparator |
OffsetDateTime.timeLineOrder()
Gets a comparator that compares two
OffsetDateTime instances based solely on the instant.
|
| Modifier and Type | Method and Description |
|---|---|
static Comparator |
ChronoLocalDate.timeLineOrder()
Gets a comparator that compares
ChronoLocalDate in time-line order ignoring the chronology.
|
static Comparator |
ChronoLocalDateTime.timeLineOrder()
Gets a comparator that compares
ChronoLocalDateTime in time-line order ignoring the chronology.
|
static Comparator |
ChronoZonedDateTime.timeLineOrder()
Gets a comparator that compares
ChronoZonedDateTime in time-line order ignoring the chronology.
|
| Modifier and Type | Method and Description |
|---|---|
Comparator |
SortedMap.comparator()
Returns the comparator used to order the keys in this map, or
null if this map uses the
natural ordering of its keys.
|
Comparator |
TreeSet.comparator()
|
Comparator |
SortedSet.comparator()
Returns the comparator used to order the elements in this set, or
null if this set uses the
natural ordering of its elements.
|
Comparator |
PriorityQueue.comparator()
Returns the comparator used to order the elements in this queue, or
null if this queue is sorted according to the
natural ordering of its elements.
|
Comparator |
TreeMap.comparator()
|
static <T |
Comparator.comparing(Function
Accepts a function that extracts a
Comparable sort key from a type
T, and returns a
Comparator<T> that compares by that sort key.
|
static <T |
Comparator.comparing(Function
Accepts a function that extracts a sort key from a type
T, and returns a
Comparator<T> that compares by that sort key using the specified
Comparator.
|
static <K extends Comparable |
Map.Entry.comparingByKey()
Returns a comparator that compares
Map.Entry in natural order on key.
|
static <K |
Map.Entry.comparingByKey(Comparator
Returns a comparator that compares
Map.Entry by key using the given
Comparator.
|
static <K |
Map.Entry.comparingByValue()
Returns a comparator that compares
Map.Entry in natural order on value.
|
static <K |
Map.Entry.comparingByValue(Comparator
Returns a comparator that compares
Map.Entry by value using the given
Comparator.
|
static <T> Comparator |
Comparator.comparingDouble(ToDoubleFunction
Accepts a function that extracts a
double sort key from a type
T, and returns a
Comparator<T> that compares by that sort key.
|
static <T> Comparator |
Comparator.comparingInt(ToIntFunction
Accepts a function that extracts an
int sort key from a type
T, and returns a
Comparator<T> that compares by that sort key.
|
static <T> Comparator |
Comparator.comparingLong(ToLongFunction
Accepts a function that extracts a
long sort key from a type
T, and returns a
Comparator<T> that compares by that sort key.
|
default Comparator |
Spliterator.getComparator()
|
static <T extends Comparable |
Comparator.naturalOrder()
Returns a comparator that compares
Comparable objects in natural order.
|
static <T> Comparator |
Comparator.nullsFirst(Comparator
Returns a null-friendly comparator that considers
null to be less than non-null.
|
static <T> Comparator |
Comparator.nullsLast(Comparator
Returns a null-friendly comparator that considers
null to be greater than non-null.
|
default Comparator |
Comparator.reversed()
Returns a comparator that imposes the reverse ordering of this comparator.
|
static <T> Comparator |
Collections.reverseOrder()
Returns a comparator that imposes the reverse of the
natural ordering on a collection of objects that implement the
Comparable interface.
|
static <T extends Comparable |
Comparator.reverseOrder()
Returns a comparator that imposes the reverse of the
natural ordering.
|
static <T> Comparator |
Collections.reverseOrder(Comparator
Returns a comparator that imposes the reverse ordering of the specified comparator.
|
default Comparator |
Comparator.thenComparing(Comparator
Returns a lexicographic-order comparator with another comparator.
|
default <U extends Comparable |
Comparator.thenComparing(Function
Returns a lexicographic-order comparator with a function that extracts a
Comparable sort key.
|
default <U> Comparator |
Comparator.thenComparing(Function
Returns a lexicographic-order comparator with a function that extracts a key to be compared with the given
Comparator.
|
default Comparator |
Comparator.thenComparingDouble(ToDoubleFunction
Returns a lexicographic-order comparator with a function that extracts a
double sort key.
|
default Comparator |
Comparator.thenComparingInt(ToIntFunction
Returns a lexicographic-order comparator with a function that extracts a
int sort key.
|
default Comparator |
Comparator.thenComparingLong(ToLongFunction
Returns a lexicographic-order comparator with a function that extracts a
long sort key.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> int |
Collections.binarySearch(List
Searches the specified list for the specified object using the binary search algorithm.
|
static <T> int |
Arrays.binarySearch(T[] a, int fromIndex, int toIndex, T key, Comparator
Searches a range of the specified array for the specified object using the binary search algorithm.
|
static <T> int |
Arrays.binarySearch(T[] a, T key, Comparator
Searches the specified array for the specified object using the binary search algorithm.
|
static <T> int |
Objects.compare(T a, T b, Comparator
Returns 0 if the arguments are identical and
c.compare(a, b) otherwise.
|
static <T |
Comparator.comparing(Function
Accepts a function that extracts a sort key from a type
T, and returns a
Comparator<T> that compares by that sort key using the specified
Comparator.
|
static <K |
Map.Entry.comparingByKey(Comparator
Returns a comparator that compares
Map.Entry by key using the given
Comparator.
|
static <K |
Map.Entry.comparingByValue(Comparator
Returns a comparator that compares
Map.Entry by value using the given
Comparator.
|
static <T> T |
Collections.max(Collection
Returns the maximum element of the given collection, according to the order induced by the specified comparator.
|
static <T> T |
Collections.min(Collection
Returns the minimum element of the given collection, according to the order induced by the specified comparator.
|
static <T> Comparator |
Comparator.nullsFirst(Comparator
Returns a null-friendly comparator that considers
null to be less than non-null.
|
static <T> Comparator |
Comparator.nullsLast(Comparator
Returns a null-friendly comparator that considers
null to be greater than non-null.
|
static <T> void |
Arrays.parallelSort(T[] a, Comparator
Sorts the specified array of objects according to the order induced by the specified comparator.
|
static <T> void |
Arrays.parallelSort(T[] a, int fromIndex, int toIndex, Comparator
Sorts the specified range of the specified array of objects according to the order induced by the specified comparator.
|
static <T> Comparator |
Collections.reverseOrder(Comparator
Returns a comparator that imposes the reverse ordering of the specified comparator.
|
void |
Vector.sort(Comparator
|
default void |
List.sort(Comparator
Sorts this list using the supplied
Comparator to compare elements.
|
void |
ArrayList.sort(Comparator
|
static <T> void |
Collections.sort(List
Sorts the specified list according to the order induced by the specified comparator.
|
static <T> void |
Arrays.sort(T[] a, Comparator
Sorts the specified array of objects according to the order induced by the specified comparator.
|
static <T> void |
Arrays.sort(T[] a, int fromIndex, int toIndex, Comparator
Sorts the specified range of the specified array of objects according to the order induced by the specified comparator.
|
default Comparator |
Comparator.thenComparing(Comparator
Returns a lexicographic-order comparator with another comparator.
|
default <U> Comparator |
Comparator.thenComparing(Function
Returns a lexicographic-order comparator with a function that extracts a key to be compared with the given
Comparator.
|
| Constructor and Description | |
|---|---|
PriorityQueue(Comparator
Creates a
PriorityQueue with the default initial capacity and whose elements are ordered according to the specified comparator.
|
|
PriorityQueue(int initialCapacity, Comparator
Creates a
PriorityQueue with the specified initial capacity that orders its elements according to the specified comparator.
|
|
TreeMap(Comparator
Constructs a new, empty tree map, ordered according to the given comparator.
|
|
TreeSet(Comparator
Constructs a new, empty tree set, sorted according to the specified comparator.
|
| Modifier and Type | Method and Description |
|---|---|
Comparator |
ConcurrentSkipListMap.comparator()
|
Comparator |
ConcurrentSkipListSet.comparator()
|
Comparator |
PriorityBlockingQueue.comparator()
Returns the comparator used to order the elements in this queue, or
null if this queue uses the
natural ordering of its elements.
|
| Modifier and Type | Method and Description |
|---|---|
void |
CopyOnWriteArrayList.sort(Comparator
|
| Constructor and Description | |
|---|---|
ConcurrentSkipListMap(Comparator
Constructs a new, empty map, sorted according to the specified comparator.
|
|
ConcurrentSkipListSet(Comparator
Constructs a new, empty set that orders its elements according to the specified comparator.
|
|
PriorityBlockingQueue(int initialCapacity, Comparator
Creates a
PriorityBlockingQueue with the specified initial capacity that orders its elements according to the specified comparator.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> BinaryOperator |
BinaryOperator.maxBy(Comparator
Returns a
BinaryOperator which returns the greater of two elements according to the specified
Comparator.
|
static <T> BinaryOperator |
BinaryOperator.minBy(Comparator
Returns a
BinaryOperator which returns the lesser of two elements according to the specified
Comparator.
|
| Modifier and Type | Method and Description |
|---|---|
Optional |
Stream.max(Comparator
Returns the maximum element of this stream according to the provided
Comparator.
|
static <T> Collector |
Collectors.maxBy(Comparator
Returns a
Collector that produces the maximal element according to a given
Comparator, described as an
Optional<T>.
|
Optional |
Stream.min(Comparator
Returns the minimum element of this stream according to the provided
Comparator.
|
static <T> Collector |
Collectors.minBy(Comparator
Returns a
Collector that produces the minimal element according to a given
Comparator, described as an
Optional<T>.
|
Stream |
Stream.sorted(Comparator
Returns a stream consisting of the elements of this stream, sorted according to the provided
Comparator.
|
| Modifier and Type | Method and Description |
|---|---|
protected Comparator |
SortingFocusTraversalPolicy.getComparator()
Returns the Comparator which will be used to sort the Components in a focus traversal cycle.
|
Comparator |
DefaultRowSorter.getComparator(int column)
Returns the
Comparator for the specified column.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
SortingFocusTraversalPolicy.setComparator(Comparator
Sets the Comparator which will be used to sort the Components in a focus traversal cycle.
|
void |
DefaultRowSorter.setComparator(int column, Comparator
Sets the
Comparator to use when sorting the specified column.
|
| Constructor and Description | |
|---|---|
SortingFocusTraversalPolicy(Comparator
Constructs a SortingFocusTraversalPolicy with the specified Comparator.
|
| Modifier and Type | Method and Description |
|---|---|
Comparator |
TableRowSorter.getComparator(int column)
Returns the
Comparator for the specified column.
|