com.sun.jdo.spi.persistence.utility
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
|
Method Summary |
boolean |
add(Object o)
Adds the specified element to this set if it is not already
present. |
boolean |
contains(Object o)
Returns true if this set contains the specified element. |
Iterator |
iterator()
Returns an iterator over the elements in this set. |
boolean |
remove(Object o)
Removes the given element from this set if it is present. |
WeakHashSet
public WeakHashSet()
iterator
public Iterator iterator()
- Returns an iterator over the elements in this set. The elements
are returned in no particular order.
- Specified by:
iterator in interface Iterable- Specified by:
iterator in interface Collection- Specified by:
iterator in interface Set- Overrides:
iterator in class HashSet
- Returns:
- an Iterator over the elements in this set.
contains
public boolean contains(Object o)
- Returns
true if this set contains the specified element.
- Specified by:
contains in interface Collection- Specified by:
contains in interface Set- Overrides:
contains in class HashSet
- Parameters:
o - element whose presence in this set is to be tested.
- Returns:
true if 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.
- Specified by:
add in interface Collection- Specified by:
add in interface Set- Overrides:
add in class HashSet
- Parameters:
o - element to be added to this set.
- Returns:
true if the set did not already contain the specified
element.
remove
public boolean remove(Object o)
- Removes the given element from this set if it is present.
- Specified by:
remove in interface Collection- Specified by:
remove in interface Set- Overrides:
remove in class HashSet
- Parameters:
o - object to be removed from this set, if present.
- Returns:
true if the set contained the specified element.
Copyright © 2012 GlassFish Community. All Rights Reserved.