API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util. Collection View Source
Author(s)
Josh Bloch
Neal Gafter
Since
1.2
Version
1.55, 04/21/06
Serial
Hierarchy
 Iterable
      Collection
Subinterfaces
Description
public interface Collection
  The root interface in the collection hierarchy.
Methods
Hide/Show inherited methods
public boolean add ( E e)
  Ensures that this collection contains the specified element (optional operation).
public boolean addAll (Collection<Object> c)
  Adds all of the elements in the specified collection to this collection (optional operation).
public void clear ()
  Removes all of the elements from this collection (optional operation).
public boolean contains (Object o)
  Returns true if this collection contains the specified element.
public boolean containsAll (Collection<Object> c)
  Returns true if this collection contains all of the elements in the specified collection.
public boolean equals (Object o)
  Compares the specified object with this collection for equality.
public int hashCode ()
  Returns the hash code value for this collection.
public boolean isEmpty ()
  Returns true if this collection contains no elements.
public Iterator< E> iterator () [Specified in Iterable]
  Returns an iterator over the elements in this collection.
public boolean remove (Object o)
  Removes a single instance of the specified element from this collection, if it is present (optional operation).
public boolean removeAll (Collection<Object> c)
  Removes all of this collection's elements that are also contained in the specified collection (optional operation).
public boolean retainAll (Collection<Object> c)
  Retains only the elements in this collection that are contained in the specified collection (optional operation).
public int size ()
  Returns the number of elements in this collection.
public Object toArray ()
  Returns an array containing all of the elements in this collection.
public T toArray ( T a)
  Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.
Fields
Hide/Show inherited fields
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar