| java.util.Collection<E> |
Known Indirect Subclasses
AbstractCollection<E>,
AbstractList<E>,
AbstractQueue<E>,
AbstractSequentialList<E>,
AbstractSet<E>,
ArrayBlockingQueue<E>,
ArrayList<E>,
BlockingQueue<E>,
ConcurrentLinkedQueue<E>,
CopyOnWriteArrayList<E>,
CopyOnWriteArraySet<E>,
DelayQueue<E extends Delayed>,
EnumSet<E extends Enum<E>>,
HashSet<E>,
LinkedBlockingQueue<E>,
LinkedHashSet<E>,
LinkedList<E>,
List<E>,
PriorityBlockingQueue<E>,
PriorityQueue<E>,
Queue<E>,
Set<E>,
SortedSet<E>,
Stack<E>,
SynchronousQueue<E>,
TreeSet<E>,
Vector<E>
|
Collection is the root of the collection hierarchy.
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Attempts to add
object to the contents of this
Collection. | |||||||||||
Attempts to add all of the objects contained in
collection
to the contents of this collection. | |||||||||||
Removes all elements from this Collection, leaving it empty.
| |||||||||||
Searches this Collection for the specified object.
| |||||||||||
Searches this Collection for all objects in the specified Collection.
| |||||||||||
Compares the argument to the receiver, and returns true if they represent
the same object using a class specific comparison.
| |||||||||||
Returns an integer hash code for the receiver.
| |||||||||||
Returns if this Collection has no elements, a size of zero.
| |||||||||||
Returns an instance of Iterator that may be used to access the
objects contained by this collection.
| |||||||||||
Removes the first occurrence of the specified object from this
Collection.
| |||||||||||
Removes all occurrences in this Collection of each object in the
specified Collection.
| |||||||||||
Removes all objects from this Collection that are not also found in the
contents of
collection. | |||||||||||
Returns a count of how many objects are contained by this collection.
| |||||||||||
Returns an array containing all elements contained in this Collection.
| |||||||||||
Returns a new array containing all elements contained in this Collection.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From interface java.lang.Iterable
| |||||||||||
Attempts to add object to the contents of this
Collection.
| object | the object to add |
|---|
true if this Collection is
modified, false otherwise| UnsupportedOperationException | when adding to this Collection is not supported |
|---|---|
| ClassCastException | when the class of the object is inappropriate for this Collection |
| IllegalArgumentException | when the object cannot be added to this Collection |
Attempts to add all of the objects contained in collection
to the contents of this collection.
| collection | the Collection of objects |
|---|
| UnsupportedOperationException | when adding to this Collection is not supported |
|---|---|
| ClassCastException | when the class of an object is inappropriate for this Collection |
| IllegalArgumentException | when an object cannot be added to this Collection |
Removes all elements from this Collection, leaving it empty.
| UnsupportedOperationException | when removing from this Collection is not supported |
|---|
Searches this Collection for the specified object.
| object | the object to search for |
|---|
Searches this Collection for all objects in the specified Collection.
| collection | the Collection of objects |
|---|
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
| object | Object the object to compare with this object. |
|---|
true if the object is the same as this
object false if it is different from this object.Returns an integer hash code for the receiver. Objects which are equal answer the same value for this method.
Returns if this Collection has no elements, a size of zero.
Returns an instance of Iterator that may be used to access the objects contained by this collection.
Removes the first occurrence of the specified object from this Collection.
| object | the object to remove |
|---|
| UnsupportedOperationException | when removing from this Collection is not supported |
|---|
Removes all occurrences in this Collection of each object in the specified Collection.
| collection | the Collection of objects to remove |
|---|
| UnsupportedOperationException | when removing from this Collection is not supported |
|---|
Removes all objects from this Collection that are not also found in the
contents of collection.
| collection | the Collection of objects to retain |
|---|
| UnsupportedOperationException | when removing from this Collection is not supported |
|---|
Returns a count of how many objects are contained by this collection.
Returns an array containing all elements contained in this Collection. If the specified array is large enough to hold the elements, the specified array is used, otherwise an array of the same type is created. If the specified array is used and is larger than this Collection, the array element following the collection elements is set to null.
| array | the array |
|---|
| ArrayStoreException | when the type of an element in this Collection cannot be stored in the type of the specified array |
|---|
Returns a new array containing all elements contained in this Collection.