edu.emory.mathcs.backport.java.util
Class Collections
java.lang.Object
edu.emory.mathcs.backport.java.util.Collections
- public class Collections
- extends java.lang.Object
Augments Collections
with methods added in Java 5.0
and higher. Adds support for dynamically typesafe collection wrappers,
and several utility methods.
- See Also:
Collections
Method Summary |
static boolean |
addAll(java.util.Collection c,
java.lang.Object[] a)
|
static Queue |
asLifoQueue(Deque deque)
|
static int |
binarySearch(java.util.List list,
java.lang.Object key)
|
static int |
binarySearch(java.util.List list,
java.lang.Object key,
java.util.Comparator c)
|
static java.util.Collection |
checkedCollection(java.util.Collection c,
java.lang.Class type)
|
static java.util.List |
checkedList(java.util.List l,
java.lang.Class type)
|
static java.util.Map |
checkedMap(java.util.Map m,
java.lang.Class keyType,
java.lang.Class valueType)
|
static java.util.Set |
checkedSet(java.util.Set s,
java.lang.Class type)
|
static java.util.SortedMap |
checkedSortedMap(java.util.SortedMap m,
java.lang.Class keyType,
java.lang.Class valueType)
|
static java.util.SortedSet |
checkedSortedSet(java.util.SortedSet s,
java.lang.Class type)
|
static void |
copy(java.util.List dest,
java.util.List src)
|
static boolean |
disjoint(java.util.Collection a,
java.util.Collection b)
|
static java.util.List |
emptyList()
|
static java.util.Map |
emptyMap()
|
static java.util.Set |
emptySet()
|
static java.util.Enumeration |
enumeration(java.util.Collection c)
|
static void |
fill(java.util.List list,
java.lang.Object obj)
|
static int |
frequency(java.util.Collection c,
java.lang.Object o)
|
static int |
indexOfSubList(java.util.List source,
java.util.List target)
|
static int |
lastIndexOfSubList(java.util.List source,
java.util.List target)
|
static java.util.ArrayList |
list(java.util.Enumeration e)
|
static java.lang.Object |
max(java.util.Collection coll)
|
static java.lang.Object |
max(java.util.Collection coll,
java.util.Comparator comp)
|
static java.lang.Object |
min(java.util.Collection coll)
|
static java.lang.Object |
min(java.util.Collection coll,
java.util.Comparator comp)
|
static java.util.List |
nCopies(int n,
java.lang.Object o)
|
static java.util.Set |
newSetFromMap(java.util.Map map)
|
static boolean |
replaceAll(java.util.List list,
java.lang.Object oldVal,
java.lang.Object newVal)
|
static void |
reverse(java.util.List list)
|
static java.util.Comparator |
reverseOrder()
|
static java.util.Comparator |
reverseOrder(java.util.Comparator cmp)
|
static void |
rotate(java.util.List list,
int distance)
|
static void |
shuffle(java.util.List list)
|
static void |
shuffle(java.util.List list,
java.util.Random rnd)
|
static java.util.Set |
singleton(java.lang.Object o)
|
static java.util.List |
singletonList(java.lang.Object o)
|
static java.util.Map |
singletonMap(java.lang.Object key,
java.lang.Object value)
|
static void |
sort(java.util.List list)
|
static void |
sort(java.util.List list,
java.util.Comparator c)
|
static void |
swap(java.util.List list,
int i,
int j)
|
static java.util.Collection |
synchronizedCollection(java.util.Collection c)
|
static java.util.List |
synchronizedList(java.util.List l)
|
static java.util.Map |
synchronizedMap(java.util.Map m)
|
static java.util.Set |
synchronizedSet(java.util.Set s)
|
static java.util.SortedMap |
synchronizedSortedMap(java.util.SortedMap m)
|
static java.util.SortedSet |
synchronizedSortedSet(java.util.SortedSet s)
|
static java.util.Collection |
unmodifiableCollection(java.util.Collection c)
|
static java.util.List |
unmodifiableList(java.util.List l)
|
static java.util.Map |
unmodifiableMap(java.util.Map m)
|
static java.util.Set |
unmodifiableSet(java.util.Set s)
|
static java.util.SortedMap |
unmodifiableSortedMap(java.util.SortedMap m)
|
static java.util.SortedSet |
unmodifiableSortedSet(java.util.SortedSet s)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
sort
public static void sort(java.util.List list)
sort
public static void sort(java.util.List list,
java.util.Comparator c)
binarySearch
public static int binarySearch(java.util.List list,
java.lang.Object key)
binarySearch
public static int binarySearch(java.util.List list,
java.lang.Object key,
java.util.Comparator c)
reverse
public static void reverse(java.util.List list)
shuffle
public static void shuffle(java.util.List list)
shuffle
public static void shuffle(java.util.List list,
java.util.Random rnd)
swap
public static void swap(java.util.List list,
int i,
int j)
fill
public static void fill(java.util.List list,
java.lang.Object obj)
copy
public static void copy(java.util.List dest,
java.util.List src)
min
public static java.lang.Object min(java.util.Collection coll)
min
public static java.lang.Object min(java.util.Collection coll,
java.util.Comparator comp)
max
public static java.lang.Object max(java.util.Collection coll)
max
public static java.lang.Object max(java.util.Collection coll,
java.util.Comparator comp)
rotate
public static void rotate(java.util.List list,
int distance)
replaceAll
public static boolean replaceAll(java.util.List list,
java.lang.Object oldVal,
java.lang.Object newVal)
indexOfSubList
public static int indexOfSubList(java.util.List source,
java.util.List target)
lastIndexOfSubList
public static int lastIndexOfSubList(java.util.List source,
java.util.List target)
unmodifiableCollection
public static java.util.Collection unmodifiableCollection(java.util.Collection c)
unmodifiableSet
public static java.util.Set unmodifiableSet(java.util.Set s)
unmodifiableSortedSet
public static java.util.SortedSet unmodifiableSortedSet(java.util.SortedSet s)
unmodifiableList
public static java.util.List unmodifiableList(java.util.List l)
unmodifiableMap
public static java.util.Map unmodifiableMap(java.util.Map m)
unmodifiableSortedMap
public static java.util.SortedMap unmodifiableSortedMap(java.util.SortedMap m)
synchronizedCollection
public static java.util.Collection synchronizedCollection(java.util.Collection c)
synchronizedSet
public static java.util.Set synchronizedSet(java.util.Set s)
synchronizedSortedSet
public static java.util.SortedSet synchronizedSortedSet(java.util.SortedSet s)
synchronizedList
public static java.util.List synchronizedList(java.util.List l)
synchronizedMap
public static java.util.Map synchronizedMap(java.util.Map m)
synchronizedSortedMap
public static java.util.SortedMap synchronizedSortedMap(java.util.SortedMap m)
checkedCollection
public static java.util.Collection checkedCollection(java.util.Collection c,
java.lang.Class type)
checkedSet
public static java.util.Set checkedSet(java.util.Set s,
java.lang.Class type)
checkedSortedSet
public static java.util.SortedSet checkedSortedSet(java.util.SortedSet s,
java.lang.Class type)
checkedList
public static java.util.List checkedList(java.util.List l,
java.lang.Class type)
checkedMap
public static java.util.Map checkedMap(java.util.Map m,
java.lang.Class keyType,
java.lang.Class valueType)
checkedSortedMap
public static java.util.SortedMap checkedSortedMap(java.util.SortedMap m,
java.lang.Class keyType,
java.lang.Class valueType)
emptySet
public static java.util.Set emptySet()
emptyList
public static java.util.List emptyList()
emptyMap
public static java.util.Map emptyMap()
singleton
public static java.util.Set singleton(java.lang.Object o)
singletonList
public static java.util.List singletonList(java.lang.Object o)
singletonMap
public static java.util.Map singletonMap(java.lang.Object key,
java.lang.Object value)
nCopies
public static java.util.List nCopies(int n,
java.lang.Object o)
reverseOrder
public static java.util.Comparator reverseOrder()
reverseOrder
public static java.util.Comparator reverseOrder(java.util.Comparator cmp)
enumeration
public static java.util.Enumeration enumeration(java.util.Collection c)
list
public static java.util.ArrayList list(java.util.Enumeration e)
frequency
public static int frequency(java.util.Collection c,
java.lang.Object o)
disjoint
public static boolean disjoint(java.util.Collection a,
java.util.Collection b)
addAll
public static boolean addAll(java.util.Collection c,
java.lang.Object[] a)
newSetFromMap
public static java.util.Set newSetFromMap(java.util.Map map)
asLifoQueue
public static Queue asLifoQueue(Deque deque)