com.sun.jdo.spi.persistence.utility
Class WeakHashSet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.HashSet
              extended by 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
WeakHashSet()
           
 
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.
 
Methods inherited from class java.util.HashSet
clear, clone, isEmpty, size
 
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.Set
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray
 

Constructor Detail

WeakHashSet

public WeakHashSet()
Method Detail

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.