public class TCollections extends TObject
Modifier and Type | Field and Description |
---|---|
static TList |
EMPTY_LIST |
static TMap |
EMPTY_MAP |
static TSet |
EMPTY_SET |
Constructor and Description |
---|
TCollections() |
Modifier and Type | Method and Description |
---|---|
static <T> boolean |
addAll(TCollection<? super T> c,
T... elements) |
static <T> int |
binarySearch(TList<? extends T> list,
T key,
TComparator<? super T> c) |
static <T> int |
binarySearch(TList<? extends TComparable<? super T>> list,
T key) |
static <E> TCollection<E> |
checkedCollection(TCollection<E> c,
Class<E> type) |
static <E> TList<E> |
checkedList(TList<E> list,
Class<E> type) |
static <K,V> TMap<K,V> |
checkedMap(TMap<K,V> m,
Class<K> keyType,
Class<V> valueType) |
static <E> TSet<E> |
checkedSet(TSet<E> s,
Class<E> type) |
static <T> void |
copy(TList<? super T> dest,
TList<? extends T> src) |
static boolean |
disjoint(TCollection<?> c1,
TCollection<?> c2) |
static <T> TEnumeration<T> |
emptyEnumeration() |
static <T> TIterator<T> |
emptyIterator() |
static <T> TList<T> |
emptyList() |
static <T> TListIterator<T> |
emptyListIterator() |
static <K,V> TMap<K,V> |
emptyMap() |
static <T> TSet<T> |
emptySet() |
static <T> TEnumeration<T> |
enumeration(TCollection<T> c) |
static <T> void |
fill(TList<? super T> list,
T obj) |
static int |
frequency(TCollection<?> c,
Object o) |
static int |
indexOfSubList(TList<?> source,
TList<?> target) |
static int |
lastIndexOfSubList(TList<?> source,
TList<?> target) |
static <T> TArrayList<T> |
list(TEnumeration<T> e) |
static <T extends Object & TComparable<? super T>> |
max(TCollection<? extends T> coll) |
static <T> T |
max(TCollection<? extends T> coll,
TComparator<? super T> comp) |
static <T extends Object & TComparable<? super T>> |
min(TCollection<? extends T> coll) |
static <T> T |
min(TCollection<? extends T> coll,
TComparator<? super T> comp) |
static <T> TList<T> |
nCopies(int n,
T o) |
static <E> TSet<E> |
newSetFromMap(TMap<E,TBoolean> map) |
static <T> boolean |
replaceAll(TList<T> list,
T oldVal,
T newVal) |
static void |
reverse(TList<?> list) |
static <T> TComparator<T> |
reverseOrder() |
static <T> TComparator<T> |
reverseOrder(TComparator<T> cmp) |
static void |
rotate(TList<?> list,
int distance) |
static void |
shuffle(TList<?> list) |
static void |
shuffle(TList<?> list,
TRandom rnd) |
static <T> TSet<T> |
singleton(T o) |
static <T> TList<T> |
singletonList(T o) |
static <K,V> TMap<K,V> |
singletonMap(K key,
V value) |
static <T extends TComparable<? super T>> |
sort(TList<T> list) |
static <T> void |
sort(TList<T> list,
TComparator<? super T> c) |
static void |
swap(TList<?> list,
int i,
int j) |
static <T> TCollection<T> |
synchronizedCollection(TCollection<T> c) |
static <T> TList<T> |
synchronizedList(TList<T> list) |
static <K,V> TMap<K,V> |
synchronizedMap(TMap<K,V> m) |
static <T> TSet<T> |
synchronizedSet(TSet<T> s) |
static <T> TCollection<T> |
unmodifiableCollection(TCollection<? extends T> c) |
static <T> TList<T> |
unmodifiableList(TList<? extends T> list) |
static <K,V> TMap<K,V> |
unmodifiableMap(TMap<? extends K,? extends V> m) |
static <T> TSet<T> |
unmodifiableSet(TSet<? extends T> s) |
public static final TSet EMPTY_SET
public static final TMap EMPTY_MAP
public static final TList EMPTY_LIST
public static <T> TIterator<T> emptyIterator()
public static <T> TListIterator<T> emptyListIterator()
public static final <T> TList<T> emptyList()
public static <T> TEnumeration<T> emptyEnumeration()
public static final <T> TSet<T> emptySet()
public static final <K,V> TMap<K,V> emptyMap()
public static <T> TList<T> singletonList(T o)
public static <T> TSet<T> singleton(T o)
public static <K,V> TMap<K,V> singletonMap(K key, V value)
public static <T> TList<T> nCopies(int n, T o)
public static void swap(TList<?> list, int i, int j)
public static <T> void sort(TList<T> list, TComparator<? super T> c)
public static <T extends TComparable<? super T>> void sort(TList<T> list)
public static void reverse(TList<?> list)
public static <T> int binarySearch(TList<? extends TComparable<? super T>> list, T key)
public static <T> int binarySearch(TList<? extends T> list, T key, TComparator<? super T> c)
public static void shuffle(TList<?> list)
public static <T> void fill(TList<? super T> list, T obj)
public static <T extends Object & TComparable<? super T>> T min(TCollection<? extends T> coll)
public static <T> T min(TCollection<? extends T> coll, TComparator<? super T> comp)
public static <T extends Object & TComparable<? super T>> T max(TCollection<? extends T> coll)
public static <T> T max(TCollection<? extends T> coll, TComparator<? super T> comp)
public static void rotate(TList<?> list, int distance)
public static <T> boolean replaceAll(TList<T> list, T oldVal, T newVal)
public static <T> TCollection<T> unmodifiableCollection(TCollection<? extends T> c)
public static <T> TCollection<T> synchronizedCollection(TCollection<T> c)
public static <T> TComparator<T> reverseOrder()
public static <T> TComparator<T> reverseOrder(TComparator<T> cmp)
public static <T> TEnumeration<T> enumeration(TCollection<T> c)
public static <T> TArrayList<T> list(TEnumeration<T> e)
public static <E> TCollection<E> checkedCollection(TCollection<E> c, Class<E> type)
public static <K,V> TMap<K,V> checkedMap(TMap<K,V> m, Class<K> keyType, Class<V> valueType)
public static int frequency(TCollection<?> c, Object o)
public static boolean disjoint(TCollection<?> c1, TCollection<?> c2)
@SafeVarargs public static <T> boolean addAll(TCollection<? super T> c, T... elements)
Copyright © 2019. All rights reserved.