| java.lang.Object com.google.gwt.emul.java.util.Collections
Collections | public class Collections (Code) | | Utility methods that operate on collections. [Sun
docs]
|
Method Summary | |
public static boolean | addAll(Collection<? super T> c, T... a) | public static int | binarySearch(List<? extends Comparable<? super T>> sortedList, T key) Perform a binary search on a sorted List, using natural ordering. | public static int | binarySearch(List<? extends T> sortedList, T key, Comparator<? super T> comparator) Perform a binary search on a sorted List, using a user-specified comparison
function.
Note: The GWT implementation differs from the JDK implementation in that it
does not do an iterator-based binary search for Lists that do not implement
RandomAccess.
Parameters: sortedList - List to search Parameters: key - value to search for Parameters: comparator - comparision function, null indicatesnatural ordering should be used. | public static void | copy(List<? super T> dest, List<? extends T> src) | public static boolean | disjoint(Collection> c1, Collection> c2) | public static List<T> | emptyList() | public static Map<K, V> | emptyMap() | public static Set<T> | emptySet() | public static Enumeration<T> | enumeration(Collection<T> c) | public static void | fill(List<? super T> list, T obj) | public static int | frequency(Collection> c, Object o) | public static T | max(Collection<? extends T> coll) | public static T | max(Collection<? extends T> coll, Comparator<? super T> comp) | public static T | min(Collection<? extends T> coll) | public static T | min(Collection<? extends T> coll, Comparator<? super T> comp) | public static List<T> | nCopies(int n, T o) | public static boolean | replaceAll(List<T> list, T oldVal, T newVal) | public static void | reverse(List<T> l) | public static Comparator<T> | reverseOrder() | public static Comparator<T> | reverseOrder(Comparator<T> cmp) | public static Set<T> | singleton(T o) | public static List<T> | singletonList(T o) | public static Map<K, V> | singletonMap(K key, V value) | public static void | sort(List<T> target) | public static void | sort(List<T> target, Comparator<? super T> c) | public static void | swap(List> list, int i, int j) | public static Collection<T> | unmodifiableCollection(Collection<? extends T> coll) | public static List<T> | unmodifiableList(List<? extends T> list) | public static Map<K, V> | unmodifiableMap(Map<? extends K, ? extends V> map) | public static Set<T> | unmodifiableSet(Set<? extends T> set) | public static SortedMap<K, V> | unmodifiableSortedMap(SortedMap<? extends K, ? extends V> map) | public static SortedSet<T> | unmodifiableSortedSet(SortedSet<? extends T> set) |
EMPTY_LIST | final public static List> EMPTY_LIST(Code) | | |
EMPTY_MAP | final public static Map, ?> EMPTY_MAP(Code) | | |
EMPTY_SET | final public static Set> EMPTY_SET(Code) | | |
binarySearch | public static int binarySearch(List<? extends Comparable<? super T>> sortedList, T key)(Code) | | Perform a binary search on a sorted List, using natural ordering.
Note: The GWT implementation differs from the JDK implementation in that it
does not do an iterator-based binary search for Lists that do not implement
RandomAccess.
Parameters: sortedList - object array to search Parameters: key - value to search for the index of an element with a matching value, or a negative numberwhich is the index of the next larger value (or just past the endof the array if the searched value is larger than all elements inthe array) minus 1 (to ensure error returns are negative) throws: ClassCastException - if key is not comparable tosortedList 's elements. |
binarySearch | public static int binarySearch(List<? extends T> sortedList, T key, Comparator<? super T> comparator)(Code) | | Perform a binary search on a sorted List, using a user-specified comparison
function.
Note: The GWT implementation differs from the JDK implementation in that it
does not do an iterator-based binary search for Lists that do not implement
RandomAccess.
Parameters: sortedList - List to search Parameters: key - value to search for Parameters: comparator - comparision function, null indicatesnatural ordering should be used. the index of an element with a matching value, or a negative numberwhich is the index of the next larger value (or just past the endof the array if the searched value is larger than all elements inthe array) minus 1 (to ensure error returns are negative) throws: ClassCastException - if key andsortedList 's elements cannot be compared bycomparator . |
copy | public static void copy(List<? super T> dest, List<? extends T> src)(Code) | | |
emptyMap | public static Map<K, V> emptyMap()(Code) | | |
emptySet | public static Set<T> emptySet()(Code) | | |
fill | public static void fill(List<? super T> list, T obj)(Code) | | |
nCopies | public static List<T> nCopies(int n, T o)(Code) | | |
replaceAll | public static boolean replaceAll(List<T> list, T oldVal, T newVal)(Code) | | |
reverse | public static void reverse(List<T> l)(Code) | | |
singleton | public static Set<T> singleton(T o)(Code) | | |
singletonList | public static List<T> singletonList(T o)(Code) | | |
singletonMap | public static Map<K, V> singletonMap(K key, V value)(Code) | | |
swap | public static void swap(List> list, int i, int j)(Code) | | |
unmodifiableList | public static List<T> unmodifiableList(List<? extends T> list)(Code) | | |
unmodifiableMap | public static Map<K, V> unmodifiableMap(Map<? extends K, ? extends V> map)(Code) | | |
unmodifiableSet | public static Set<T> unmodifiableSet(Set<? extends T> set)(Code) | | |
|
|