public class Collections extends Object
| Modifier and Type | Field and Description |
|---|---|
static List |
EMPTY_LIST |
static Map |
EMPTY_MAP |
static Set |
EMPTY_SET |
| Modifier and Type | Method and Description |
|---|---|
static <T> boolean |
addAll(Collection<? super T> c,
T... a) |
static <T> Queue<T> |
asLifoQueue(Deque<T> deque) |
static <T> int |
binarySearch(List<? extends Comparable<? super T>> list,
T object) |
static <T> int |
binarySearch(List<? extends T> list,
T object,
Comparator<? super T> comparator) |
static <E> Collection<E> |
checkedCollection(Collection<E> c,
Class<E> type) |
static <T> void |
copy(List<? super T> destination,
List<? extends T> source) |
static boolean |
disjoint(Collection<?> c1,
Collection<?> c2) |
static <T> List<T> |
emptyList() |
static <K,V> Map<K,V> |
emptyMap() |
static <T> Set<T> |
emptySet() |
static <T> Enumeration<T> |
enumeration(Collection<T> collection) |
static <T> void |
fill(List<? super T> list,
T object) |
static int |
frequency(Collection<?> c,
Object o) |
static int |
indexOfSubList(List<?> list,
List<?> sublist) |
static int |
lastIndexOfSubList(List<?> list,
List<?> sublist) |
static <T> ArrayList<T> |
list(Enumeration<T> enumeration) |
static <T extends Object & Comparable<? super T>> |
max(Collection<? extends T> collection) |
static <T> T |
max(Collection<? extends T> collection,
Comparator<? super T> comparator) |
static <T extends Object & Comparable<? super T>> |
min(Collection<? extends T> collection) |
static <T> T |
min(Collection<? extends T> collection,
Comparator<? super T> comparator) |
static <T> List<T> |
nCopies(int length,
T object) |
static <E> Set<E> |
newSetFromMap(Map<E,Boolean> map) |
static <T> boolean |
replaceAll(List<T> list,
T obj,
T obj2) |
static void |
reverse(List<?> list) |
static <T> Comparator<T> |
reverseOrder() |
static <T> Comparator<T> |
reverseOrder(Comparator<T> c) |
static void |
rotate(List<?> lst,
int dist) |
static void |
shuffle(List<?> list) |
static void |
shuffle(List<?> list,
Random random) |
static <E> Set<E> |
singleton(E object) |
static <E> List<E> |
singletonList(E object) |
static <K,V> Map<K,V> |
singletonMap(K key,
V value) |
static <T extends Comparable<? super T>> |
sort(List<T> list) |
static <T> void |
sort(List<T> list,
Comparator<? super T> comparator) |
static void |
swap(List<?> list,
int index1,
int index2) |
static <T> Collection<T> |
synchronizedCollection(Collection<T> collection) |
static <T> List<T> |
synchronizedList(List<T> list) |
static <K,V> Map<K,V> |
synchronizedMap(Map<K,V> map) |
static <E> Set<E> |
synchronizedSet(Set<E> set) |
static <K,V> SortedMap<K,V> |
synchronizedSortedMap(SortedMap<K,V> map) |
static <E> SortedSet<E> |
synchronizedSortedSet(SortedSet<E> set) |
static <E> Collection<E> |
unmodifiableCollection(Collection<? extends E> collection) |
static <E> List<E> |
unmodifiableList(List<? extends E> list) |
static <K,V> Map<K,V> |
unmodifiableMap(Map<? extends K,? extends V> map) |
static <E> Set<E> |
unmodifiableSet(Set<? extends E> set) |
static <K,V> SortedMap<K,V> |
unmodifiableSortedMap(SortedMap<K,? extends V> map) |
static <E> SortedSet<E> |
unmodifiableSortedSet(SortedSet<E> set) |
public static final List EMPTY_LIST
public static final Set EMPTY_SET
public static final Map EMPTY_MAP
public static <T> int binarySearch(List<? extends Comparable<? super T>> list, T object)
public static <T> int binarySearch(List<? extends T> list, T object, Comparator<? super T> comparator)
public static <T> Enumeration<T> enumeration(Collection<T> collection)
public static <T> void fill(List<? super T> list, T object)
public static <T extends Object & Comparable<? super T>> T max(Collection<? extends T> collection)
public static <T> T max(Collection<? extends T> collection, Comparator<? super T> comparator)
public static <T extends Object & Comparable<? super T>> T min(Collection<? extends T> collection)
public static <T> T min(Collection<? extends T> collection, Comparator<? super T> comparator)
public static <T> List<T> nCopies(int length, T object)
public static void reverse(List<?> list)
public static <T> Comparator<T> reverseOrder()
public static <T> Comparator<T> reverseOrder(Comparator<T> c)
public static void shuffle(List<?> list)
public static <E> Set<E> singleton(E object)
public static <E> List<E> singletonList(E object)
public static <K,V> Map<K,V> singletonMap(K key, V value)
public static <T extends Comparable<? super T>> void sort(List<T> list)
public static <T> void sort(List<T> list, Comparator<? super T> comparator)
public static void swap(List<?> list, int index1, int index2)
public static <T> boolean replaceAll(List<T> list, T obj, T obj2)
public static void rotate(List<?> lst, int dist)
public static <T> ArrayList<T> list(Enumeration<T> enumeration)
public static <T> Collection<T> synchronizedCollection(Collection<T> collection)
public static <E> Collection<E> unmodifiableCollection(Collection<? extends E> collection)
public static <K,V> SortedMap<K,V> unmodifiableSortedMap(SortedMap<K,? extends V> map)
public static int frequency(Collection<?> c, Object o)
public static final <T> List<T> emptyList()
public static final <T> Set<T> emptySet()
public static final <K,V> Map<K,V> emptyMap()
public static <E> Collection<E> checkedCollection(Collection<E> c, Class<E> type)
public static <T> boolean addAll(Collection<? super T> c, T... a)
public static boolean disjoint(Collection<?> c1, Collection<?> c2)
Copyright © 2026. All rights reserved.