|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
wt.fc.collections.AbstractWTCollection
wt.fc.collections.WTHashSet
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
Nested Class Summary |
Nested classes inherited from class wt.fc.collections.AbstractWTCollection |
AbstractWTCollection.PersistableCollection |
Field Summary | |
private static String |
CLASSNAME
|
(package private) WTKeyedHashMap |
data
|
(package private) static int |
DEFAULT_INITIAL_CAPACITY
|
(package private) static int |
DEFAULT_KEY_MASK
|
static long |
EXTERNALIZATION_VERSION_UID
|
protected static long |
OLD_FORMAT_VERSION_UID
|
private static Object |
PRESENT
|
private static String |
RESOURCE
|
(package private) static long |
serialVersionUID
|
Fields inherited from class wt.fc.collections.AbstractWTCollection |
|
Fields inherited from interface wt.fc.collections.WTCollection |
DEFLATED_ON_SERIALIZATION |
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 | |
boolean |
add(Persistable p)
Supported API: false |
boolean |
add(QueryKey query_key)
Supported API: false |
boolean |
add(WTReference ref)
Supported API: false |
void |
addElement(Object anObj)
Add the specified object to the result processor, and increase the size by one Supported API: false |
Iterator |
classIterator()
Supported API: false |
void |
clear()
Supported API: false |
Object |
clone()
Supported API: true |
WTHashSet |
clone(boolean deep)
Supported API: true |
(package private) boolean |
connect(WTReference r,
boolean add)
Add the reference to the collection's internal data structures |
boolean |
contains(QueryKey query_key)
Supported API: false |
boolean |
contains(WTReference ref)
Supported API: false |
boolean |
containsInstance(Class filter)
Supported API: false |
protected boolean |
containsNonPersisted(Persistable p)
Attempts to remove the given non-persisted Persistable from the collection. |
boolean |
equals(Object o)
Supported API: false |
static int |
getInitialCapacity(int size)
Get the initial capacity that should be used for a set that is intended to hold the given number of elements. |
int |
getKeyMask()
Supported API: false |
WTReference |
getReference(Persistable p)
Get a reference used internally by this collection that refers to the given Persistable. |
WTReference |
getReference(QueryKey q)
Get a reference used internally by this collection that refers to the given QueryKey. |
WTReference |
getReference(WTReference r)
Get a reference used internally by this collection that refers to the same object as the given reference. |
WTReference[] |
getReferences(WTReference r)
Get all reference used internally by this collection that refer to the same object as the given reference. |
int |
hashCode()
Supported API: false |
void |
inflate()
Supported API: false |
boolean |
isDeflatedOnSerialization()
Gets the value of the attribute: deflatedOnSerialization. |
Iterator |
persistableIterator()
Supported API: false |
Iterator |
persistableIterator(Class filter,
boolean include_subclasses)
Supported API: false |
Iterator |
queryKeyIterator()
Supported API: false |
Iterator |
queryKeyIterator(Class filter,
boolean include_subclasses)
Supported API: false |
void |
readExternal(ObjectInput input)
Reads the non-transient fields of this class from an external source. |
private boolean |
readOldVersion(ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source, which is not the current version. |
protected boolean |
readVersion(WTHashSet thisObject,
ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source. |
Iterator |
referenceIterator()
Supported API: false |
Iterator |
referenceIterator(Class filter,
boolean include_subclasses)
Supported API: false |
(package private) void |
referenceRemoved(WTReference r)
|
boolean |
remove(QueryKey query_key)
Supported API: false |
boolean |
remove(WTReference ref)
Supported API: false |
boolean |
removeAll(Class filter,
boolean include_subclasses)
Supported API: false |
protected boolean |
removeNonPersisted(Persistable p)
Attempts to remove the given non-persisted Persistable from the collection. |
boolean |
retainAll(Class filter,
boolean include_subclasses)
Supported API: false |
void |
setDeflatedOnSerialization(boolean a_DeflatedOnSerialization)
Sets the value of the attribute: deflatedOnSerialization. |
int |
size()
Supported API: false |
WTCollection |
subCollection(Class filter,
boolean include_subclasses)
Supported API: false |
void |
writeExternal(ObjectOutput output)
Writes the non-transient fields of this class to an external source. |
Methods inherited from class wt.fc.collections.AbstractWTCollection |
add, addAll, addAll, connect, connect, connect, connect, connect, connect, connectAll, connectAll, contains, contains, containsOnly, deflate, getIteratorListener, getLastReturnedReference, isEnabled, iterator, persistableCollection, referenceAdded, remove, remove, setLastReturnedReference, subCollection, toArray, toArray, toArray, toArray, toArray, toArray, toIdArray |
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, connect, connect, connect, connectAll, connectAll, contains, contains, containsOnly, deflate, isEnabled, iterator, persistableCollection, remove, remove, subCollection, toArray, toArray, toArray, toArray, toArray, toArray, toIdArray |
Methods inherited from interface java.util.Collection |
containsAll, isEmpty, removeAll, retainAll |
Methods inherited from interface java.util.Set |
add, addAll, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, toArray, toArray |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
static final long serialVersionUID
public static final long EXTERNALIZATION_VERSION_UID
protected static final long OLD_FORMAT_VERSION_UID
private static final Object PRESENT
static final int DEFAULT_INITIAL_CAPACITY
static final int DEFAULT_KEY_MASK
transient WTKeyedHashMap data
Constructor Detail |
public WTHashSet()
public WTHashSet(int initial_capacity)
initial_capacity
- public WTHashSet(int initial_capacity, int key_mask)
initial_capacity
- key_mask
- public WTHashSet(Collection c)
c
- public WTHashSet(Collection c, int key_mask)
c
- key_mask
- Method Detail |
public void writeExternal(ObjectOutput output) throws IOException
writeExternal
in interface Externalizable
output
-
IOException
public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
input
-
IOException
ClassNotFoundException
protected boolean readVersion(WTHashSet thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
thisObject
- input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
private boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
public boolean isDeflatedOnSerialization()
isDeflatedOnSerialization
in interface WTCollection
isDeflatedOnSerialization
in class AbstractWTCollection
public void setDeflatedOnSerialization(boolean a_DeflatedOnSerialization) throws WTPropertyVetoException
setDeflatedOnSerialization
in interface WTCollection
setDeflatedOnSerialization
in class AbstractWTCollection
a_DeflatedOnSerialization
-
WTPropertyVetoException
public boolean add(Persistable p)
add
in interface WTCollection
add
in class AbstractWTCollection
p
-
public boolean add(QueryKey query_key)
add
in interface WTCollection
add
in class AbstractWTCollection
query_key
-
public boolean add(WTReference ref)
add
in interface WTCollection
add
in class AbstractWTCollection
ref
-
public Iterator classIterator()
classIterator
in interface WTCollection
classIterator
in class AbstractWTCollection
public void clear()
clear
in interface Collection
public Object clone()
public WTHashSet clone(boolean deep)
deep
-
public boolean contains(QueryKey query_key)
contains
in interface WTCollection
contains
in class AbstractWTCollection
query_key
-
public boolean contains(WTReference ref)
contains
in interface WTCollection
contains
in class AbstractWTCollection
ref
-
public boolean containsInstance(Class filter)
containsInstance
in interface WTCollection
containsInstance
in class AbstractWTCollection
filter
-
public boolean equals(Object o)
equals
in interface Collection
equals
in class AbstractWTCollection
o
-
public int getKeyMask()
getKeyMask
in interface WTCollection
getKeyMask
in class AbstractWTCollection
public int hashCode()
hashCode
in interface Collection
hashCode
in class AbstractWTCollection
public void inflate() throws WTException
inflate
in interface WTCollection
inflate
in class AbstractWTCollection
WTException
public Iterator persistableIterator() throws WTException
persistableIterator
in interface WTCollection
persistableIterator
in class AbstractWTCollection
WTException
public Iterator persistableIterator(Class filter, boolean include_subclasses) throws WTException
persistableIterator
in interface WTCollection
persistableIterator
in class AbstractWTCollection
filter
- include_subclasses
-
WTException
public Iterator queryKeyIterator()
queryKeyIterator
in interface WTCollection
queryKeyIterator
in class AbstractWTCollection
public Iterator queryKeyIterator(Class filter, boolean include_subclasses)
queryKeyIterator
in interface WTCollection
queryKeyIterator
in class AbstractWTCollection
filter
- include_subclasses
-
public Iterator referenceIterator()
referenceIterator
in interface WTCollection
referenceIterator
in class AbstractWTCollection
public Iterator referenceIterator(Class filter, boolean include_subclasses)
referenceIterator
in interface WTCollection
referenceIterator
in class AbstractWTCollection
filter
- include_subclasses
-
protected boolean removeNonPersisted(Persistable p)
removeNonPersisted
in class AbstractWTCollection
p
-
public boolean remove(QueryKey query_key)
remove
in interface WTCollection
remove
in class AbstractWTCollection
query_key
-
public boolean remove(WTReference ref)
remove
in interface WTCollection
remove
in class AbstractWTCollection
ref
-
public boolean removeAll(Class filter, boolean include_subclasses)
removeAll
in interface WTCollection
removeAll
in class AbstractWTCollection
filter
- include_subclasses
-
public boolean retainAll(Class filter, boolean include_subclasses)
retainAll
in interface WTCollection
retainAll
in class AbstractWTCollection
filter
- include_subclasses
-
public int size()
size
in interface ResultProcessor
public WTCollection subCollection(Class filter, boolean include_subclasses)
subCollection
in interface WTCollection
subCollection
in class AbstractWTCollection
filter
- include_subclasses
-
public void addElement(Object anObj)
addElement
in interface ResultProcessor
anObj
- boolean connect(WTReference r, boolean add)
AbstractWTCollection
connect
in class AbstractWTCollection
protected boolean containsNonPersisted(Persistable p)
AbstractWTCollection
containsNonPersisted
in class AbstractWTCollection
p
-
void referenceRemoved(WTReference r)
referenceRemoved
in class AbstractWTCollection
public WTReference getReference(Persistable p)
AbstractWTCollection
getReference
in interface ReferenceBased
getReference
in class AbstractWTCollection
p
-
public WTReference getReference(QueryKey q)
AbstractWTCollection
getReference
in interface ReferenceBased
getReference
in class AbstractWTCollection
q
-
public WTReference getReference(WTReference r)
AbstractWTCollection
getReference
in interface ReferenceBased
getReference
in class AbstractWTCollection
r
-
public WTReference[] getReferences(WTReference r)
AbstractWTCollection
getReferences
in interface ReferenceBased
getReferences
in class AbstractWTCollection
r
-
public static int getInitialCapacity(int size)
size
- The number of elements that will be added to the new set
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |