Package | Description |
---|---|
java.util |
Contains the collections framework, legacy collection classes, event model,
date and time facilities, random-number generator, and miscellaneous utility
classes.
|
Modifier and Type | Method and Description |
---|---|
static <T> Comparator<T> |
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> Comparator<T> |
Collections.reverseOrder(Comparator<T> cmp)
Returns a comparator that imposes the reverse ordering of the specified
comparator.
|
Modifier and Type | Method and Description |
---|---|
static <T> int |
Collections.binarySearch(List<? extends T> list,
T key,
Comparator<? super T> c)
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<? super T> c)
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<? super T> c)
Searches the specified array for the specified object using the binary
search algorithm.
|
static <T> int |
Objects.compare(T a,
T b,
Comparator<? super T> c)
Returns 0 if the arguments are identical and
c.compare(a, b) otherwise. |
static <T> T |
Collections.max(Collection<? extends T> coll,
Comparator<? super T> comp)
Returns the maximum element of the given collection, according to the
order induced by the specified comparator.
|
static <T> T |
Collections.min(Collection<? extends T> coll,
Comparator<? super T> comp)
Returns the minimum element of the given collection, according to the
order induced by the specified comparator.
|
static <T> Comparator<T> |
Collections.reverseOrder(Comparator<T> cmp)
Returns a comparator that imposes the reverse ordering of the specified
comparator.
|
static <T> void |
Collections.sort(List<T> list,
Comparator<? super T> c)
Sorts the specified list according to the order induced by the
specified comparator.
|
static <T> void |
Arrays.sort(T[] a,
Comparator<? super T> c)
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<? super T> c)
Sorts the specified range of the specified array of objects according
to the order induced by the specified comparator.
|
Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. Use of this specification is subject to license terms.