Class WeakHashSet
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- java.util.HashSet
-
- com.sun.jdo.spi.persistence.utility.WeakHashSet
-
- All Implemented Interfaces:
Serializable,Cloneable,Iterable,Collection,Set
public class WeakHashSet extends HashSet
A weak HashSet. An element stored in the WeakHashSet might be garbage collected, if there is no strong reference to this element.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WeakHashSet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(Object o)Adds the specified element to this set if it is not already present.booleancontains(Object o)Returnstrueif this set contains the specified element.Iteratoriterator()Returns an iterator over the elements in this set.booleanremove(Object o)Removes the given element from this set if it is present.-
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
-
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
-
-
-
Method Detail
-
iterator
public Iterator iterator()
Returns an iterator over the elements in this set. The elements are returned in no particular order.
-
contains
public boolean contains(Object o)
Returnstrueif this set contains the specified element.
-
add
public boolean add(Object o)
Adds the specified element to this set if it is not already present.
-
remove
public boolean remove(Object o)
Removes the given element from this set if it is present.
-
-