|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Collection<E>
Collection is the root of the collection hierarchy.
| Method Summary | ||
|---|---|---|
boolean |
add(E object)
Attempts to add object to the contents of this
Collection. |
|
boolean |
addAll(Collection<? extends E> collection)
Attempts to add all of the objects contained in collection
to the contents of this collection. |
|
void |
clear()
Removes all elements from this Collection, leaving it empty. |
|
boolean |
contains(Object object)
Searches this Collection for the specified object. |
|
boolean |
containsAll(Collection<?> collection)
Searches this Collection for all objects in the specified Collection. |
|
boolean |
equals(Object object)
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. |
|
int |
hashCode()
Returns an integer hash code for the receiver. |
|
boolean |
isEmpty()
Returns if this Collection has no elements, a size of zero. |
|
Iterator<E> |
iterator()
Returns an instance of Iterator that may be used to access the
objects contained by this collection. |
|
boolean |
remove(Object object)
Removes the first occurrence of the specified object from this Collection. |
|
boolean |
removeAll(Collection<?> collection)
Removes all occurrences in this Collection of each object in the specified Collection. |
|
boolean |
retainAll(Collection<?> collection)
Removes all objects from this Collection that are not also found in the contents of collection. |
|
int |
size()
Returns a count of how many objects are contained by this collection. |
|
Object[] |
toArray()
Returns a new array containing all elements contained in this Collection. |
|
|
toArray(T[] array)
Returns an array containing all elements contained in this Collection. |
|
| Method Detail |
|---|
boolean add(E object)
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 Collectionboolean addAll(Collection<? extends E> collection)
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 Collectionvoid clear()
UnsupportedOperationException - when removing from this Collection is not supportedisEmpty(),
size()boolean contains(Object object)
object - the object to search for
boolean containsAll(Collection<?> collection)
collection - the Collection of objects
boolean equals(Object object)
equals in class Objectobject - 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.hashCode()int hashCode()
hashCode in class Objectequals(java.lang.Object)boolean isEmpty()
size()Iterator<E> iterator()
Iterator that may be used to access the
objects contained by this collection.
iterator in interface Iterable<E>boolean remove(Object object)
object - the object to remove
UnsupportedOperationException - when removing from this Collection is not supportedboolean removeAll(Collection<?> collection)
collection - the Collection of objects to remove
UnsupportedOperationException - when removing from this Collection is not supportedboolean retainAll(Collection<?> collection)
collection.
collection - the Collection of objects to retain
UnsupportedOperationException - when removing from this Collection is not supportedint size()
Object[] toArray()
<T> T[] toArray(T[] array)
array - the array
ArrayStoreException - when the type of an element in this Collection cannot be
stored in the type of the specified array
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||