Collections (Java SE 24 & JDK 24)
-
Field Summary
Fields
-
Method Summary
static <T> booleanAdds all of the specified elements to the specified collection.
static <T> intSearches the specified list for the specified object using the binary search algorithm.
static <T> intSearches the specified list for the specified object using the binary search algorithm.
Returns a dynamically typesafe view of the specified collection.
static <E> List<E> Returns a dynamically typesafe view of the specified list.
static <K,V> Map <K, V> Returns a dynamically typesafe view of the specified map.
Returns a dynamically typesafe view of the specified navigable map.
Returns a dynamically typesafe view of the specified navigable set.
Returns a dynamically typesafe view of the specified queue.
static <E> Set<E> Returns a dynamically typesafe view of the specified set.
Returns a dynamically typesafe view of the specified sorted map.
Returns a dynamically typesafe view of the specified sorted set.
static <T> voidcopy(List<? super T> dest, List<? extends T> src) Copies all of the elements from one list into another.
static booleanReturns
trueif the two specified collections have no elements in common.Returns an enumeration that has no elements.
Returns an iterator that has no elements.
static final <T> List<T> Returns an empty list (immutable).
Returns a list iterator that has no elements.
static final <K,V> Map <K, V> emptyMap()Returns an empty map (immutable).
Returns an empty navigable map (immutable).
Returns an empty navigable set (immutable).
static final <T> Set<T> emptySet()Returns an empty set (immutable).
Returns an empty sorted map (immutable).
Returns an empty sorted set (immutable).
Returns an enumeration over the specified collection.
static <T> voidfill(List<? super T> list, T obj) Replaces all of the elements of the specified list with the specified element.
static intReturns the number of elements in the specified collection equal to the specified object.
static intReturns the starting position of the first occurrence of the specified target list within the specified source list, or -1 if there is no such occurrence.
static intReturns the starting position of the last occurrence of the specified target list within the specified source list, or -1 if there is no such occurrence.
Returns an array list containing the elements returned by the specified enumeration in the order they are returned by the enumeration.
Returns the maximum element of the given collection, according to the natural ordering of its elements.
static <T> TReturns the maximum element of the given collection, according to the order induced by the specified comparator.
Returns the minimum element of the given collection, according to the natural ordering of its elements.
static <T> TReturns the minimum element of the given collection, according to the order induced by the specified comparator.
static <T> List<T> nCopies(int n, T o) Returns an immutable list consisting of
ncopies of the specified object.Returns a sequenced set backed by the specified map.
static <E> Set<E> Returns a set backed by the specified map.
static <T> booleanreplaceAll(List<T> list, T oldVal, T newVal) Replaces all occurrences of one specified value in a list with another.
static voidReverses the order of the elements in the specified list.
Returns a comparator that imposes the reverse of the natural ordering on a collection of objects that implement the
Comparableinterface.Returns a comparator that imposes the reverse ordering of the specified comparator.
static voidrotate(List<?> list, int distance) Rotates the elements in the specified list by the specified distance.
static voidRandomly permutes the specified list using a default source of randomness.
static voidRandomly permute the specified list using the specified source of randomness.
static voidRandomly permute the specified list using the specified source of randomness.
static <T> Set<T> singleton(T o) Returns an immutable set containing only the specified object.
static <T> List<T> singletonList(T o) Returns an immutable list containing only the specified object.
static <K,V> Map <K, V> singletonMap(K key, V value) Returns an immutable map, mapping only the specified key to the specified value.
static <T extends Comparable<? super T>>
voidSorts the specified list into ascending order, according to the natural ordering of its elements.
static <T> voidSorts the specified list according to the order induced by the specified comparator.
static voidswap(List<?> list, int i, int j) Swaps the elements at the specified positions in the specified list.
Returns a synchronized (thread-safe) collection backed by the specified collection.
static <T> List<T> Returns a synchronized (thread-safe) list backed by the specified list.
static <K,V> Map <K, V> Returns a synchronized (thread-safe) map backed by the specified map.
Returns a synchronized (thread-safe) navigable map backed by the specified navigable map.
Returns a synchronized (thread-safe) navigable set backed by the specified navigable set.
static <T> Set<T> Returns a synchronized (thread-safe) set backed by the specified set.
Returns a synchronized (thread-safe) sorted map backed by the specified sorted map.
Returns a synchronized (thread-safe) sorted set backed by the specified sorted set.
static <T> List<T> unmodifiableList(List<? extends T> list) static <K,V> Map <K, V> unmodifiableMap(Map<? extends K, ? extends V> m) static <T> Set<T> unmodifiableSet(Set<? extends T> s)
-
Field Details
-
EMPTY_SET
-
EMPTY_LIST
-
EMPTY_MAP
-
-
Method Details
-
sort
-
sort
-
binarySearch
-
binarySearch
-
reverse
-
shuffle
-
shuffle
-
shuffle
-
swap
-
fill
-
copy
-
min
-
min
-
max
-
max
-
rotate
-
replaceAll
-
indexOfSubList
-
lastIndexOfSubList
-
unmodifiableCollection
-
unmodifiableSequencedCollection
-
unmodifiableSet
-
unmodifiableSequencedSet
-
unmodifiableSortedSet
-
unmodifiableList
-
unmodifiableMap
-
unmodifiableSequencedMap
-
unmodifiableSortedMap
-
synchronizedCollection
-
synchronizedSet
-
synchronizedSortedSet
-
synchronizedList
-
synchronizedMap
-
synchronizedSortedMap
-
checkedCollection
-
checkedQueue
-
checkedSet
-
checkedSortedSet
-
checkedList
-
checkedMap
-
checkedSortedMap
-
emptyIterator
-
emptyListIterator
-
emptyEnumeration
-
emptySet
-
emptySortedSet
-
emptyList
-
emptyMap
-
emptySortedMap
-
singleton
-
singletonList
-
singletonMap
-
nCopies
-
reverseOrder
-
reverseOrder
-
enumeration
-
list
-
frequency
-
disjoint
-
addAll
-
newSetFromMap
-
newSequencedSetFromMap
-
asLifoQueue
-