|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
wt.fc.collections.SynchronizedCollections.SynchronizedCollection
wt.fc.collections.SynchronizedCollections.SynchronizedWTCollection
Field Summary | |
(package private) Collection |
c
|
(package private) Object |
lock
|
(package private) WTCollection |
wtc
|
Fields inherited from interface wt.fc.collections.WTCollection |
DEFLATED_ON_SERIALIZATION |
Constructor Summary | |
(package private) |
SynchronizedCollections.SynchronizedWTCollection(WTCollection wtc)
|
(package private) |
SynchronizedCollections.SynchronizedWTCollection(WTCollection wtc,
Object lock)
|
Method Summary | |
boolean |
add(Object o)
Adds the given QueryKey, WTReference, Persistable or collection thereof. |
boolean |
add(Persistable p)
Adds the given object to this collection. |
boolean |
add(QueryKey key)
Adds the given object to this collection. |
boolean |
add(WTReference ref)
Adds the given object to this collection. |
boolean |
addAll(Collection other)
Adds the given collection of objects to this collection. |
boolean |
addAll(QueryResult qr)
Adds the contents of a QueryResult to this collection. |
Iterator |
classIterator()
Returns an iterator over the classes that have instances in this collection. |
void |
clear()
|
boolean |
connect(Persistable p,
WTCollection source)
Connects the given object from the source collection to this collection. |
boolean |
connect(Persistable p,
WTCollection source,
boolean add_if_not_present)
Connects the given object from the source collection to this collection. |
boolean |
connect(QueryKey key,
WTCollection source)
Connects the given object from the source collection to this collection. |
boolean |
connect(QueryKey key,
WTCollection source,
boolean add_if_not_present)
Connects the given object from the source collection to this collection. |
boolean |
connect(WTReference ref,
WTCollection source)
Connects the given object from the source collection to this collection. |
boolean |
connect(WTReference ref,
WTCollection source,
boolean add_if_not_present)
Connects the given object from the source collection to this collection. |
boolean |
connectAll(WTCollection source)
Connects the elements in the source collection to this collection. |
boolean |
connectAll(WTCollection source,
boolean add_if_not_present)
Connects the elements in the source collection to this collection. |
boolean |
contains(Persistable p)
Determines if the collection contains the given object in some form. |
boolean |
contains(QueryKey key)
Determines if the collection contains the given object in some form. |
boolean |
contains(WTReference ref)
Determines if the collection contains the given object in some form. |
boolean |
containsAll(Collection other)
|
boolean |
containsInstance(Class clazz)
Returns true if there is at least one object in the collection that the filter class is assignable from. |
boolean |
containsOnly(Class clazz)
Determines whether this collection only contains objects that are assignable from the given filter. |
void |
deflate()
Dereferences all Persistables in this collection that have QueryKeys. |
int |
getKeyMask()
Returns this collection's key mask. |
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 key. |
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 the references used internally by this collection that refers to the given reference. |
void |
inflate()
Retrieves the full persistables for any objects in this collection that currently only have QueryKeys or WTReferences. |
boolean |
isDeflatedOnSerialization()
Gets the value of the attribute: DEFLATED_ON_SERIALIZATION. |
boolean |
isEmpty()
|
boolean |
isEnabled(int mask)
Returns true if the key types in the given mask are enabled for this collection. |
Iterator |
iterator()
Returns an iterator over the references in the collection, per the contract of the #referenceIterator() API. |
Collection |
persistableCollection()
Provides a Persistable-based view of the objects in this WTCollection. |
Iterator |
persistableIterator()
Returns an iterator over the objects in this collection, as Persistables. |
Iterator |
persistableIterator(Class clazz,
boolean param)
Refines persistableIterator() to only return objects that are either direct or descendent instances of the filter class, depending on the value of include_subclasses. |
Iterator |
queryKeyIterator()
Returns an iterator over the QueryKeys in this collection. |
Iterator |
queryKeyIterator(Class clazz,
boolean param)
Refines queryKeyIterator() to only return keys that are either direct or descendent instances of the filter class, depending on the value of include_subclasses. |
Iterator |
referenceIterator()
Returns an Iterator over the objects in this collection, as WTReferences. |
Iterator |
referenceIterator(Class clazz,
boolean param)
Refines referenceIterator() to only return references that are either direct or descendent instances of the filter class, depending on the value of include_subclasses. |
boolean |
remove(Object o)
Removes any form of the object in the collection. |
boolean |
remove(Persistable p)
Removes the object from this collection. |
boolean |
remove(QueryKey key)
Removes the object from this collection. |
boolean |
remove(WTReference ref)
Removes the object from this collection. |
boolean |
removeAll(Class clazz,
boolean param)
Removes all objects in this collection that are assignable from the given class. |
boolean |
removeAll(Collection other)
|
boolean |
retainAll(Class clazz,
boolean param)
Removes all objects in this collection that are not assignable from the given class. |
boolean |
retainAll(Collection other)
|
void |
setDeflatedOnSerialization(boolean param)
Sets the value of the attribute: DEFLATED_ON_SERIALIZATION. |
int |
size()
|
WTCollection |
subCollection(Class clazz)
Returns a WTCollection containing the objects in this collection that are assignable from the given filter class. |
WTCollection |
subCollection(Class clazz,
boolean param)
Returns a sub collection of all the objects in this collection that are either direct or descendent instances of the filter class, depending on the value of include_subclasses. |
Object[] |
toArray()
Returns an object array filled with WTReferences to all the objects in this collection. |
long[] |
toArray(long[] values)
Fills the given array with the long ids from each QueryKey in this collection. |
Object[] |
toArray(Object[] a)
Fills the given array with the objects in this collection. |
Persistable[] |
toArray(Persistable[] p)
Fills the given array with the Persistables in this collection. |
QueryKey[] |
toArray(QueryKey[] key)
Fills the given array with the QueryKeys in this collection. |
WTReference[] |
toArray(WTReference[] ref)
Fills the given array with WTReferences to all the objects in this collection. |
long[] |
toIdArray()
Returns an array with the long ids from each QueryKey in this collection. |
String |
toString()
|
Methods inherited from class java.util.AbstractCollection |
contains |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface wt.fc.collections.WTCollection |
add, addAll, contains, iterator, remove, toArray, toArray |
Methods inherited from interface java.util.Collection |
clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, size |
Field Detail |
WTCollection wtc
Collection c
Object lock
Constructor Detail |
SynchronizedCollections.SynchronizedWTCollection(WTCollection wtc)
SynchronizedCollections.SynchronizedWTCollection(WTCollection wtc, Object lock)
Method Detail |
public boolean add(WTReference ref)
WTCollection
WTCollection.add(Object)
for documentation for this method.
add
in interface WTCollection
ref
-
public boolean add(Persistable p)
WTCollection
WTCollection.add(Object)
for documentation for this method.
add
in interface WTCollection
p
-
public boolean add(QueryKey key)
WTCollection
WTCollection.add(Object)
for documentation for this method.
add
in interface WTCollection
key
-
public boolean addAll(QueryResult qr)
WTCollection
addAll
in interface WTCollection
qr
-
public Iterator classIterator()
WTCollection
classIterator
in interface WTCollection
public boolean connect(WTReference ref, WTCollection source)
WTCollection
connect
in interface WTCollection
ref
- source
-
WTCollection.connect(WTReference,WTCollection,boolean)
public boolean connect(Persistable p, WTCollection source)
WTCollection
connect
in interface WTCollection
p
- source
-
WTCollection.connect(Persistable,WTCollection,boolean)
public boolean connect(QueryKey key, WTCollection source)
WTCollection
connect
in interface WTCollection
key
- source
-
WTCollection.connect(QueryKey,WTCollection,boolean)
public boolean connect(WTReference ref, WTCollection source, boolean add_if_not_present)
WTCollection
add_if_not_present
is true
, then if the object does not exist yet in this
collection, it is added to it.
connect
in interface WTCollection
ref
- source
- add_if_not_present
- When true
, the object is added to this collection if it isn't currently contained by it.
WTCollection.connect(WTReference,WTCollection,boolean)
public boolean connect(Persistable p, WTCollection source, boolean add_if_not_present)
WTCollection
add_if_not_present
is true
, then if the object does not exist yet in this
collection, it is added to it.
connect
in interface WTCollection
p
- source
- add_if_not_present
- When true
, the object is added to this collection if it isn't currently contained by it.
WTCollection.connect(Persistable,WTCollection,boolean)
public boolean connect(QueryKey key, WTCollection source, boolean add_if_not_present)
WTCollection
add_if_not_present
is true
, then if the object does not exist yet in this
collection, it is added to it.
connect
in interface WTCollection
key
- source
- add_if_not_present
- When true
, the object is added to this collection if it isn't currently contained by it.
WTCollection.connect(QueryKey,WTCollection,boolean)
public boolean connectAll(WTCollection source)
WTCollection
connectAll
in interface WTCollection
source
-
public boolean connectAll(WTCollection source, boolean add_if_not_present)
WTCollection
add_if_not_present
is true
, all of the objects in the source collection
are added to this collection.
connectAll
in interface WTCollection
source
- add_if_not_present
- When true
, objects in source that aren't currently in this collection are added to this collection.
public boolean contains(QueryKey key)
WTCollection
WTCollection.contains(Object)
for further documentation.
contains
in interface WTCollection
key
-
public boolean contains(Persistable p)
WTCollection
WTCollection.contains(Object)
for further documentation.
contains
in interface WTCollection
p
-
public boolean contains(WTReference ref)
WTCollection
WTCollection.contains(Object)
for further documentation.
contains
in interface WTCollection
ref
-
public boolean containsInstance(Class clazz)
WTCollection
containsInstance
in interface WTCollection
clazz
-
public boolean containsOnly(Class clazz)
WTCollection
containsOnly
in interface WTCollection
clazz
-
public void deflate()
WTCollection
deflate
in interface WTCollection
public int getKeyMask()
WTCollection
getKeyMask
in interface WTCollection
CollectionsHelper.OBJECT_IDENTIFIER
,
CollectionsHelper.VERSION_FOREIGN_KEY
public void inflate() throws WTException
WTCollection
inflate
in interface WTCollection
WTException
public boolean isDeflatedOnSerialization()
WTCollection
true
, this collection only serializes QueryKeys
for objects that have them. Objects without QueryKeys are still serialized.
This property defaults to false and is transient to force callers
to explicitly enable it, to avoid unintentional deflations.
isDeflatedOnSerialization
in interface WTCollection
public boolean isEnabled(int mask)
WTCollection
isEnabled
in interface WTCollection
mask
-
WTCollection.getKeyMask()
public Collection persistableCollection()
WTCollection
The resulting collection is backed by this collection, so changes
to one are reflected in the other.
Supported API: true
persistableCollection
in interface WTCollection
public Iterator persistableIterator() throws WTException
WTCollection
persistableIterator
in interface WTCollection
WTException
public Iterator persistableIterator(Class clazz, boolean param) throws WTException
WTCollection
If a refresh is necessary, implementations should only refresh objects
of the given filter class, rather than all the objects in the collection.
Supported API: false
persistableIterator
in interface WTCollection
clazz
- param
-
WTException
WTCollection.persistableIterator()
public Iterator queryKeyIterator()
WTCollection
queryKeyIterator
in interface WTCollection
public Iterator queryKeyIterator(Class clazz, boolean param)
WTCollection
queryKeyIterator
in interface WTCollection
clazz
- param
-
WTCollection.queryKeyIterator()
public Iterator referenceIterator()
WTCollection
referenceIterator
in interface WTCollection
public Iterator referenceIterator(Class clazz, boolean param)
WTCollection
referenceIterator
in interface WTCollection
clazz
- param
-
WTCollection.queryKeyIterator()
public boolean remove(Persistable p)
WTCollection
WTCollection.remove(Object)
for further documentation. Removes the object from this collection.
See WTCollection.remove(Object)
for further documentation.
remove
in interface WTCollection
p
-
public boolean remove(WTReference ref)
WTCollection
WTCollection.remove(Object)
for further documentation. See WTCollection.remove(Object)
for further
documentation.
remove
in interface WTCollection
ref
-
public boolean remove(QueryKey key)
WTCollection
WTCollection.remove(Object)
for further documentation. See WTCollection.remove(Object)
for further
documentation.
remove
in interface WTCollection
key
-
public boolean removeAll(Class clazz, boolean param)
WTCollection
removeAll
in interface WTCollection
clazz
- param
-
public boolean retainAll(Class clazz, boolean param)
WTCollection
retainAll
in interface WTCollection
clazz
- param
-
public void setDeflatedOnSerialization(boolean param) throws WTPropertyVetoException
WTCollection
true
, this collection only serializes QueryKeys
for objects that have them. Objects without QueryKeys are still serialized.
This property defaults to false and is transient to force callers
to explicitly enable it, to avoid unintentional deflations.
setDeflatedOnSerialization
in interface WTCollection
param
-
WTPropertyVetoException
public WTCollection subCollection(Class clazz)
WTCollection
WTCollection.subCollection(Class,
boolean)
for further documentation.
subCollection
in interface WTCollection
clazz
-
public WTCollection subCollection(Class clazz, boolean param)
WTCollection
subCollection
in interface WTCollection
clazz
- param
-
public long[] toArray(long[] values)
WTCollection
toArray
in interface WTCollection
values
-
public WTReference[] toArray(WTReference[] ref)
WTCollection
toArray
in interface WTCollection
ref
-
public QueryKey[] toArray(QueryKey[] key)
WTCollection
toArray
in interface WTCollection
key
-
public Persistable[] toArray(Persistable[] p)
WTCollection
toArray
in interface WTCollection
p
-
public long[] toIdArray()
WTCollection
toIdArray
in interface WTCollection
public WTReference getReference(WTReference r)
ReferenceBased
getReference
in interface ReferenceBased
r
-
public WTReference getReference(QueryKey q)
ReferenceBased
getReference
in interface ReferenceBased
q
-
public WTReference getReference(Persistable p)
ReferenceBased
getReference
in interface ReferenceBased
p
-
public WTReference[] getReferences(WTReference r)
ReferenceBased
getReferences
in interface ReferenceBased
r
-
public boolean add(Object o)
add
in interface Collection
public boolean addAll(Collection other)
addAll
in interface Collection
public void clear()
clear
in interface Collection
public boolean containsAll(Collection other)
containsAll
in interface Collection
public boolean isEmpty()
isEmpty
in interface Collection
public Iterator iterator()
iterator
in interface Collection
public boolean remove(Object o)
remove
in interface Collection
public boolean removeAll(Collection other)
removeAll
in interface Collection
public boolean retainAll(Collection other)
retainAll
in interface Collection
public int size()
size
in interface Collection
public Object[] toArray()
toArray
in interface Collection
public Object[] toArray(Object[] a)
toArray
in interface Collection
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |