|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection java.util.AbstractSet java.util.IdentityHashMap.KeySet
Constructor Summary | |
private |
IdentityHashMap.KeySet()
|
Method Summary | |
void |
clear()
Removes all of the elements from this set (optional operation). |
boolean |
contains(Object o)
Returns true if this set contains the specified element. |
int |
hashCode()
Returns the hash code value for this set. |
Iterator |
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 (optional operation). |
boolean |
removeAll(Collection c)
Removes from this set all of its elements that are contained in the specified collection (optional operation). |
int |
size()
Returns the number of elements in this set (its cardinality). |
Methods inherited from class java.util.AbstractSet |
equals |
Methods inherited from class java.util.AbstractCollection |
add, addAll, containsAll, isEmpty, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Set |
add, addAll, containsAll, isEmpty, retainAll, toArray, toArray |
Constructor Detail |
private IdentityHashMap.KeySet()
Method Detail |
public Iterator iterator()
Set
iterator
in interface Set
iterator
in class AbstractCollection
public int size()
Set
size
in interface Set
size
in class AbstractCollection
public boolean contains(Object o)
Set
e
such that (o==null ? e==null :
o.equals(e))
.
contains
in interface Set
contains
in class AbstractCollection
o
- object to be checked for containment in this collection.
public boolean remove(Object o)
Set
e
such that
(o==null ? e==null : o.equals(e))
, if the set contains
such an element. Returns true if the set contained the
specified element (or equivalently, if the set changed as a result of
the call). (The set will not contain the specified element once the
call returns.)
remove
in interface Set
remove
in class AbstractCollection
o
- element to be removed from this collection, if present.
public boolean removeAll(Collection c)
AbstractSet
This implementation determines which is the smaller of this set and the specified collection, by invoking the size method on each. If this set has fewer elements, then the implementation iterates over this set, checking each element returned by the iterator in turn to see if it is contained in the specified collection. If it is so contained, it is removed from this set with the iterator's remove method. If the specified collection has fewer elements, then the implementation iterates over the specified collection, removing from this set each element returned by the iterator, using this set's remove method.
Note that this implementation will throw an UnsupportedOperationException if the iterator returned by the iterator method does not implement the remove method.
removeAll
in interface Set
removeAll
in class AbstractSet
c
- elements to be removed from this set.
AbstractCollection.remove(Object)
,
AbstractCollection.contains(Object)
public void clear()
Set
clear
in interface Set
clear
in class AbstractCollection
public int hashCode()
AbstractSet
This implementation enumerates over the set, calling the hashCode method on each element in the collection, and adding up the results.
hashCode
in interface Set
hashCode
in class AbstractSet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |