|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Set<E>
Set is a collection which does not allow duplicate elements.
| Method Summary | ||
|---|---|---|
boolean |
add(E object)
Adds the specified object to this Set. |
|
boolean |
addAll(Collection<? extends E> collection)
Adds the objects in the specified Collection which do not exist in this Set. |
|
void |
clear()
Removes all elements from this Set, leaving it empty. |
|
boolean |
contains(Object object)
Searches this Set for the specified object. |
|
boolean |
containsAll(Collection<?> collection)
Searches this Set 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 Set has no elements, a size of zero. |
|
Iterator<E> |
iterator()
Returns an Iterator on the elements of this Set. |
|
boolean |
remove(Object object)
Removes any occurrence of the specified object from this Set. |
|
boolean |
removeAll(Collection<?> collection)
Removes all objects in the specified Collection from this Set. |
|
boolean |
retainAll(Collection<?> collection)
Removes all objects from this Set that are not contained in the specified Collection. |
|
int |
size()
Returns the number of elements in this Set. |
|
Object[] |
toArray()
Returns an array containing all elements contained in this Set. |
|
|
toArray(T[] array)
Returns an array containing all elements contained in this Set. |
|
| Method Detail |
|---|
boolean add(E object)
add in interface Collection<E>object - the object to add
UnsupportedOperationException - when adding to this Set is not supported
ClassCastException - when the class of the object is inappropriate for this Set
IllegalArgumentException - when the object cannot be added to this Setboolean addAll(Collection<? extends E> collection)
addAll in interface Collection<E>collection - the Collection of objects
UnsupportedOperationException - when adding to this Set is not supported
ClassCastException - when the class of an object is inappropriate for this Set
IllegalArgumentException - when an object cannot be added to this Setvoid clear()
clear in interface Collection<E>UnsupportedOperationException - when removing from this Set is not supportedisEmpty(),
size()boolean contains(Object object)
contains in interface Collection<E>object - the object to search for
boolean containsAll(Collection<?> collection)
containsAll in interface Collection<E>collection - the Collection of objects
boolean equals(Object object)
equals in interface Collection<E>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 interface Collection<E>hashCode in class Objectequals(java.lang.Object)boolean isEmpty()
isEmpty in interface Collection<E>size()Iterator<E> iterator()
iterator in interface Collection<E>iterator in interface Iterable<E>Iteratorboolean remove(Object object)
remove in interface Collection<E>object - the object to remove
UnsupportedOperationException - when removing from this Set is not supportedboolean removeAll(Collection<?> collection)
removeAll in interface Collection<E>collection - the Collection of objects to remove
UnsupportedOperationException - when removing from this Set is not supportedboolean retainAll(Collection<?> collection)
retainAll in interface Collection<E>collection - the Collection of objects to retain
UnsupportedOperationException - when removing from this Set is not supportedint size()
size in interface Collection<E>Object[] toArray()
toArray in interface Collection<E><T> T[] toArray(T[] array)
toArray in interface Collection<E>array - the array
ArrayStoreException - when the type of an element in this Set 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 | |||||||||