wt.fc.collections
Class WTHashSet

java.lang.Object
  extended by java.util.AbstractCollection
      extended by wt.fc.collections.AbstractWTCollection
          extended by wt.fc.collections.WTHashSet
All Implemented Interfaces:
Externalizable, Serializable, Cloneable, Iterable, Collection, Set, ReferenceBased, WTCollection, WTSet, ResultProcessor

public class WTHashSet
extends wt.fc.collections.AbstractWTCollection
implements Cloneable, ResultProcessor, WTSet, Externalizable

A hash-based implementation of WTSet.

WTHashSet implements wt.fc.ResultProcessor to provide better integration with the persistence layer. By implementing ResultProcessor, the default collections can be used in place of a QueryResult when retrieving data. The APIs to accomplish this are:

 PersistenceManager.find(StatementSpec, ResultProcessor)
 PersisenceManagerSvr.query(StatementSpec, ResultProcessor)
 

In addition to a no-arg clone method, WTHashSet provides a "deep" clone in which the references are copied and the Persistables in the set are cloned using PersistenceCloner.

A WTHashSet can be constructed with a key mask. The default key mask is CollectionsHelper.OBJECT_IDENTIFIER.

Supported API: true

Extendable: false

See Also:
Serialized Form

Constructor Summary
WTHashSet()
          

Supported API: true
WTHashSet(Collection c)
          

Supported API: true
WTHashSet(Collection c, int key_mask)
          

Supported API: true
WTHashSet(int initial_capacity)
          

Supported API: true
WTHashSet(int initial_capacity, int key_mask)
          

Supported API: true
 
Method Summary
 void addElement(Object anObj)
          This method is called by the low level persistence layer to add the specified object to the result.
 Object clone()
          

Supported API: true
 WTHashSet clone(boolean deep)
          

Supported API: true
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wt.fc.collections.WTCollection
add, addAll, addAll, connect, connect, connect, connectAll, contains, contains, containsOnly, deflate, isEnabled, iterator, persistableCollection, remove, remove, toArray, toArray, toArray, toArray, toArray, toArray, toIdArray
 
Methods inherited from interface java.util.Set
add, addAll, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

WTHashSet

public WTHashSet()


Supported API: true


WTHashSet

public WTHashSet(int initial_capacity)


Supported API: true

Parameters:
initial_capacity -

WTHashSet

public WTHashSet(int initial_capacity,
                 int key_mask)


Supported API: true

Parameters:
initial_capacity -
key_mask -

WTHashSet

public WTHashSet(Collection c)


Supported API: true

Parameters:
c -

WTHashSet

public WTHashSet(Collection c,
                 int key_mask)


Supported API: true

Parameters:
c -
key_mask -
Method Detail

clone

public Object clone()


Supported API: true

Overrides:
clone in class Object
Returns:
Object

clone

public WTHashSet clone(boolean deep)


Supported API: true

Parameters:
deep -
Returns:
WTHashSet

addElement

public void addElement(Object anObj)
                throws WTException
This method is called by the low level persistence layer to add the specified object to the result. The actual type of the object is based on the type of query. It may be a Persistable or an Object[].

Supported API: true

Specified by:
addElement in interface ResultProcessor
Parameters:
anObj - Result object to add.
Throws:
WTException - - if the object can't be added to the result
WTException