|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Set<E>
A collection that contains no duplicate elements. More formally, sets
contain no pair of elements e1
and e2
such that
e1.equals(e2)
, and at most one null element. As implied by
its name, this interface models the mathematical set abstraction.
Method Summary | ||
---|---|---|
boolean |
add(E o)
Adds the specified element to this set if it is not already present |
|
boolean |
addAll(Collection<? extends E> c)
Adds all of the elements in the specified collection to this set if they're not already present. |
|
void |
clear()
Removes all of the elements from this set |
|
boolean |
contains(Object o)
Returns true if this set contains the specified element. |
|
boolean |
containsAll(Collection<?> c)
Returns true if this set contains all of the elements of the specified collection. |
|
boolean |
equals(Object o)
Compares the specified object with this set for equality. |
|
int |
hashCode()
Returns the hash code value for this set. |
|
boolean |
isEmpty()
Returns true if this set contains no elements. |
|
Iterator<E> |
iterator()
Returns an iterator over the elements in this set. |
|
boolean |
remove(Object o)
Removes the specified element from this set if it is present. |
|
boolean |
removeAll(Collection<?> c)
Removes the specified element from this set if it is present. |
|
boolean |
retainAll(Collection<?> c)
Removes from this set all of its elements that are contained in the specified collection. |
|
int |
size()
Retains only the elements in this set that are contained in the specified collection. |
|
Object[] |
toArray()
Returns the number of elements in this set (its cardinality). |
|
|
toArray(T[] a)
Returns an array containing all of the elements in this set. |
Method Detail |
---|
boolean add(E o)
add
in interface Collection<E>
boolean addAll(Collection<? extends E> c)
addAll
in interface Collection<E>
void clear()
clear
in interface Collection<E>
boolean contains(Object o)
contains
in interface Collection<E>
boolean containsAll(Collection<?> c)
containsAll
in interface Collection<E>
boolean equals(Object o)
equals
in interface Collection<E>
equals
in class Object
int hashCode()
hashCode
in interface Collection<E>
hashCode
in class Object
boolean isEmpty()
isEmpty
in interface Collection<E>
Iterator<E> iterator()
iterator
in interface Collection<E>
iterator
in interface Iterable<E>
boolean remove(Object o)
remove
in interface Collection<E>
boolean removeAll(Collection<?> c)
removeAll
in interface Collection<E>
boolean retainAll(Collection<?> c)
retainAll
in interface Collection<E>
int size()
size
in interface Collection<E>
Object[] toArray()
toArray
in interface Collection<E>
<T> T[] toArray(T[] a)
toArray
in interface Collection<E>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |