img
Method
Description
Inser ts the elements specified by elements into the
static <T> boolean
addAll(Collection <? super T> c,
collection specified by c. Returns true if the
T ... elements)
elements were added and false other wise.
static <T> Queue<T> asLifoQueue(Deque<T> c)
Returns a last-in, first-out view of c. (Added by Java
SE 6.)
Searches for value in list ordered according to c.
static <T>
int binar ySearch(List<? extends T> list,
Returns the position of value in list, or a negative
T value,
value if value is not found.
Comparator<? super T> c)
Searches for value in list. The list must be sor ted.
static <T>
Returns the position of value in list, or a negative
int binar ySearch(List<? extends
Comparable<? super T>> list,
value if value is not found.
T value)
static <E> Collection<E>
Returns a run-time type-safe view of a collection.
checkedCollection(Collection<E> c,
An attempt to inser t an incompatible element will
Class<E> t)
cause a ClassCastException.
Returns a run-time type-safe view of a List. An
static <E> List<E>
checkedList(List<E> c, Class<E> t)
attempt to inser t an incompatible element will
cause a ClassCastException.
static <K, V> Map<K, V>
Returns a run-time type-safe view of a Map. An
checkedMap(Map<K, V> c,
attempt to inser t an incompatible element will
Class<K> keyT,
cause a ClassCastException.
Class<V> valueT)
static <E> List<E>
Returns a run-time type-safe view of a Set. An
checkedSet(Set<E> c, Class<E> t)
attempt to inser t an incompatible element will
cause a ClassCastException.
static <K, V> Sor tedMap<K, V>
Returns a run-time type-safe view of a SortedMap.
checkedSor tedMap(Sor tedMap<K, V> c,
An attempt to inser t an incompatible element will
Class<K> keyT,
cause a ClassCastException.
Class<V> valueT)
Returns a run-time type-safe view of a SortedSet.
static <E> Sor tedSet<E>
checkedSor tedSet(Sor tedSet<E> c, Class<E> t)
An attempt to inser t an incompatible element will
cause a ClassCastException.
static <T> void copy(List<? super T> list1,
Copies the elements of list2 to list1.
List<? extends T> list2)
static boolean disjoint(Collection<?> a,
Compares the elements in a to elements in b.
Collection<?> b)
Returns true if the two collections contain no
common elements (i.e., the collections contain
disjoint sets of elements). Other wise, returns true.
static <T> List<T> emptyList( )
Returns an immutable, empty List object of the
inferred type.
static <K, V> Map<K, V> emptyMap( )
Returns an immutable, empty Map object of the
inferred type.
static <T> Set<T> emptySet( )
Returns an immutable, empty Set object of the
inferred type.
Returns an enumeration over c. (See "The
static <T> Enumeration<T>
enumeration(Collection<T> c)
Enumeration Inter face," later in this chapter.)
static <T> void fill(List<? super T> list, T obj)
Assigns obj to each element of list.
TABLE 17-14
The Algorithms Defined by Collections
Search WWH :
Custom Search
Previous Page
Java SE 6 Topic Index
Next Page
Java SE 6 Bookmarks
Home