Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

com.gentleware.services.util

Class WeakHashSet

com.gentleware.services.util.WeakHashSet

public class WeakHashSet


Set implementation that does not prevent items from being garbage collected.

(Copied from java.util.HashSet, changed backing Map from HashMap to WeakHashMap and removed clone and serialization support.)

Created : kelvin, 21.01.2003, 10:06:19


 Attribute Summary
private static Object  PRESENT
 
private WeakHashMap  _map
 
arrow_up
 

 Constructor Summary
public   WeakHashSet()
Constructs a new, empty set; the backing WeakHashMap instance has default initial capacity (16) and load factor (0.75). 
public   WeakHashSet(Collection c)
Constructs a new set containing the elements in the specified collection. 
public   WeakHashSet(int initialCapacity, float loadFactor)
Constructs a new, empty set; the backing WeakHashMap instance has the specified initial capacity and the specified load factor. 
public   WeakHashSet(int initialCapacity)
Constructs a new, empty set; the backing WeakHashMap instance has the specified initial capacity and default load factor, which is 0.75
arrow_up
 

 Method Summary
public boolean   add(Object o)
Adds the specified element to this set if it is not already present. 
public void   clear()
Removes all of the elements from this set. 
public boolean   contains(Object o)
Returns true if this set contains the specified element. 
public boolean   isEmpty()
Returns true if this set contains no elements. 
public Iterator   iterator()
Returns an iterator over the elements in this set. 
public boolean   remove(Object o)
Removes the specified element from this set if it is present. 
public int   size()
Returns the number of elements in this set (its cardinality). 
arrow_up
 

Tagged Values
static false
gentleware-imported-line-number 16
gentleware-imported-package-statement-line-number 5
 

 Attribute Detail

PRESENT

private static Object PRESENT

arrow_up


_map

private WeakHashMap _map

arrow_up
 Constructor Detail

WeakHashSet

public com.gentleware.services.util.WeakHashSet WeakHashSet()


Constructs a new, empty set; the backing WeakHashMap instance has default initial capacity (16) and load factor (0.75).  
Returns:
arrow_up


WeakHashSet

public com.gentleware.services.util.WeakHashSet WeakHashSet(Collection c)


Constructs a new set containing the elements in the specified collection. The WeakHashMap is created with default load factor (0.75) and an initial capacity sufficient to contain the elements in the specified collection.  
Parameters:
c - the collection whose elements are to be placed into this set.
Returns:
Exceptions:
NullPointerException if the specified collection is null.
arrow_up


WeakHashSet

public com.gentleware.services.util.WeakHashSet WeakHashSet(int initialCapacity, float loadFactor)


Constructs a new, empty set; the backing WeakHashMap instance has the specified initial capacity and the specified load factor.  
Parameters:
initialCapacity - the initial capacity of the hash map.
loadFactor - the load factor of the hash map.
Returns:
Exceptions:
IllegalArgumentException if the initial capacity is less than zero, or if the load factor is nonpositive.
arrow_up


WeakHashSet

public com.gentleware.services.util.WeakHashSet WeakHashSet(int initialCapacity)


Constructs a new, empty set; the backing WeakHashMap instance has the specified initial capacity and default load factor, which is 0.75.  
Parameters:
initialCapacity - the initial capacity of the hash table.
Returns:
Exceptions:
IllegalArgumentException if the initial capacity is less than zero.
arrow_up
 Method Detail

add

public boolean add(Object o)


Adds the specified element to this set if it is not already present.  
Parameters:
o - element to be added to this set.
Returns:
true if the set did not already contain the specified element.
arrow_up


clear

public void clear()


Removes all of the elements from this set.  
arrow_up


contains

public boolean contains(Object o)


Returns true if this set contains the specified element.  
Parameters:
o - element whose presence in this set is to be tested.
Returns:
true if this set contains the specified element.
arrow_up


isEmpty

public boolean isEmpty()


Returns true if this set contains no elements.  
Returns:
true if this set contains no elements.
arrow_up


iterator

public Iterator iterator()


Returns an iterator over the elements in this set. The elements are returned in no particular order.  
Returns:
an Iterator over the elements in this set.
See also:
ConcurrentModificationException
arrow_up


remove

public boolean remove(Object o)


Removes the specified element from this set if it is present.  
Parameters:
o - object to be removed from this set, if present.
Returns:
true if the set contained the specified element.
arrow_up


size

public int size()


Returns the number of elements in this set (its cardinality).  
Returns:
the number of elements in this set (its cardinality).
arrow_up
Created  2004 - 12 - 1

    Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

Generated with Poseidon for UMLTM.
Poseidon is a registered trademark of Gentleware AG in Germany, USA and other countries. Copyright 2003-2004 Gentleware AG, Schanzenstr. 70, 20357 Hamburg, Germany. All Rights Reserved.

UML is a trademark or registered trademark of Object Management Group, Inc. in the U.S. and other countries.