public class WeakHashSet
extends java.util.HashSet
Constructor and Description |
---|
WeakHashSet() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(java.lang.Object o)
Adds the specified element to this set if it is not already
present.
|
boolean |
contains(java.lang.Object o)
Returns
true if this set contains the specified element. |
java.util.Iterator |
iterator()
Returns an iterator over the elements in this set.
|
boolean |
remove(java.lang.Object o)
Removes the given element from this set if it is present.
|
addAll, containsAll, retainAll, toArray, toArray, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
public java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in interface java.util.Set
iterator
in class java.util.HashSet
public boolean contains(java.lang.Object o)
true
if this set contains the specified element.contains
in interface java.util.Collection
contains
in interface java.util.Set
contains
in class java.util.HashSet
o
- element whose presence in this set is to be tested.true
if this set contains the specified element.public boolean add(java.lang.Object o)
add
in interface java.util.Collection
add
in interface java.util.Set
add
in class java.util.HashSet
o
- element to be added to this set.true
if the set did not already contain the specified element.public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection
remove
in interface java.util.Set
remove
in class java.util.HashSet
o
- object to be removed from this set, if present.true
if the set contained the specified element.