Example usage for Java java.util Collections fields, constructors, methods, implement or subclass
The text is from its open source code.
Set | EMPTY_SET The empty set (immutable). |
List | EMPTY_LIST The empty list (immutable). |
Map | EMPTY_MAP The empty map (immutable). |
boolean | addAll(Collection super T> c, T... elements) Adds all of the specified elements to the specified collection. |
Queue | asLifoQueue(Deque Returns a view of a Deque as a Last-in-first-out (Lifo) Queue . |
int | binarySearch(List extends Comparable super T>> list, T key) Searches the specified list for the specified object using the binary search algorithm. |
int | binarySearch(List extends T> list, T key, Comparator super T> c) Searches the specified list for the specified object using the binary search algorithm. |
Collection | checkedCollection(Collection Returns a dynamically typesafe view of the specified collection. |
List | checkedList(List Returns a dynamically typesafe view of the specified list. |
Map | checkedMap(Map Returns a dynamically typesafe view of the specified map. |
Set | checkedSet(Set Returns a dynamically typesafe view of the specified set. |
SortedMap | checkedSortedMap(SortedMap Returns a dynamically typesafe view of the specified sorted map. |
SortedSet | checkedSortedSet(SortedSet Returns a dynamically typesafe view of the specified sorted set. |
void | copy(List super T> dest, List extends T> src) Copies all of the elements from one list into another. |
boolean | disjoint(Collection> c1, Collection> c2) Returns true if the two specified collections have no elements in common. |
Enumeration | emptyEnumeration() Returns an enumeration that has no elements. |
Iterator | emptyIterator() Returns an iterator that has no elements. |
List | emptyList() Returns an empty list (immutable). |
ListIterator | emptyListIterator() Returns a list iterator that has no elements. |
Map | emptyMap() Returns an empty map (immutable). |
NavigableSet | emptyNavigableSet() Returns an empty navigable set (immutable). |
Set | emptySet() Returns an empty set (immutable). |
SortedMap | emptySortedMap() Returns an empty sorted map (immutable). |
SortedSet | emptySortedSet() Returns an empty sorted set (immutable). |
Enumeration | enumeration(final Collection Returns an enumeration over the specified collection. |
void | fill(List super T> list, T obj) Replaces all of the elements of the specified list with the specified element. |
int | frequency(Collection> c, Object o) Returns the number of elements in the specified collection equal to the specified object. |
int | indexOfSubList(List> source, List> target) Returns 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. |
int | lastIndexOfSubList(List> source, List> target) Returns 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. |
ArrayList | list(Enumeration Returns an array list containing the elements returned by the specified enumeration in the order they are returned by the enumeration. |
T | max(Collection extends T> coll) Returns the maximum element of the given collection, according to the natural ordering of its elements. |
T | 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. |
T | min(Collection extends T> coll) Returns the minimum element of the given collection, according to the natural ordering of its elements. |
T | 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. |
List | nCopies(int n, T o) Returns an immutable list consisting of n copies of the specified object. |
Set | newSetFromMap(Map Returns a set backed by the specified map. |
boolean | replaceAll(List Replaces all occurrences of one specified value in a list with another. |
void | reverse(List> list) Reverses the order of the elements in the specified list. This method runs in linear time. |
Comparator | reverseOrder() Returns a comparator that imposes the reverse of the natural ordering on a collection of objects that implement the Comparable interface. |
Comparator | reverseOrder(Comparator Returns a comparator that imposes the reverse ordering of the specified comparator. |
void | rotate(List> list, int distance) Rotates the elements in the specified list by the specified distance. |
void | shuffle(List> list) Randomly permutes the specified list using a default source of randomness. |
void | shuffle(List> list, Random rnd) Randomly permute the specified list using the specified source of randomness. |
Set | singleton(T o) Returns an immutable set containing only the specified object. |
List | singletonList(T o) Returns an immutable list containing only the specified object. |
Map | singletonMap(K key, V value) Returns an immutable map, mapping only the specified key to the specified value. |
void | sort(List Sorts the specified list into ascending order, according to the Comparable natural ordering of its elements. |
void | sort(List Sorts the specified list according to the order induced by the specified comparator. |
void | swap(List> list, int i, int j) Swaps the elements at the specified positions in the specified list. |
void | swap(Object[] arr, int i, int j) Swaps the two specified elements in the specified array. |
Collection | synchronizedCollection(Collection Returns a synchronized (thread-safe) collection backed by the specified collection. |
List | synchronizedList(List Returns a synchronized (thread-safe) list backed by the specified list. |
Map | synchronizedMap(Map Returns a synchronized (thread-safe) map backed by the specified map. |
NavigableSet | synchronizedNavigableSet(NavigableSet Returns a synchronized (thread-safe) navigable set backed by the specified navigable set. |
Set | synchronizedSet(Set Returns a synchronized (thread-safe) set backed by the specified set. |
SortedMap | synchronizedSortedMap(SortedMap Returns a synchronized (thread-safe) sorted map backed by the specified sorted map. |
SortedSet | synchronizedSortedSet(SortedSet Returns a synchronized (thread-safe) sorted set backed by the specified sorted set. |
Collection | unmodifiableCollection(Collection extends T> c) Returns an unmodifiable view of the specified collection. |
List | unmodifiableList(List extends T> list) Returns an unmodifiable view of the specified list. |
Map | unmodifiableMap(Map extends K, ? extends V> m) Returns an unmodifiable view of the specified map. |
NavigableMap | unmodifiableNavigableMap(NavigableMap Returns an unmodifiable view of the specified navigable map. |
NavigableSet | unmodifiableNavigableSet(NavigableSet Returns an unmodifiable view of the specified navigable set. |
Set | unmodifiableSet(Set extends T> s) Returns an unmodifiable view of the specified set. |
SortedMap | unmodifiableSortedMap(SortedMap Returns an unmodifiable view of the specified sorted map. |
SortedSet | unmodifiableSortedSet(SortedSet Returns an unmodifiable view of the specified sorted set. |