wt.fc.collections
Class UnmodifiableCollections.UnmodifiableCollection

java.lang.Object
  extended byjava.util.AbstractCollection
      extended bywt.fc.collections.UnmodifiableCollections.UnmodifiableCollection
All Implemented Interfaces:
Collection, ReferenceBased, Serializable, WTCollection
Direct Known Subclasses:
UnmodifiableCollections.UnmodifiableList, UnmodifiableCollections.UnmodifiableSet
Enclosing class:
UnmodifiableCollections

static class UnmodifiableCollections.UnmodifiableCollection
extends AbstractCollection
implements Serializable, ReferenceBased, WTCollection


Field Summary
(package private)  WTCollection c
           
 
Fields inherited from interface wt.fc.collections.WTCollection
DEFLATED_ON_SERIALIZATION
 
Constructor Summary
(package private) UnmodifiableCollections.UnmodifiableCollection(WTCollection c)
           
 
Method Summary
 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(QueryResult queryResult)
          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.
(package private)  boolean connect(WTReference r, boolean add)
           
 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(Object o)
          Returns true if the collection contains the given QueryKey, WTReference, or Persistable, in any form.
 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 c)
           
 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.
 boolean equals(Object o)
           
 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.
 int hashCode()
           
 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 retainAll(Class clazz, boolean param)
          Removes all objects in this collection that are not assignable from the given class.
 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
add, addAll, removeAll, retainAll
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wt.fc.collections.WTCollection
add, addAll
 
Methods inherited from interface java.util.Collection
removeAll, retainAll
 

Field Detail

c

WTCollection c
Constructor Detail

UnmodifiableCollections.UnmodifiableCollection

UnmodifiableCollections.UnmodifiableCollection(WTCollection c)
Method Detail

add

public boolean add(WTReference ref)
Description copied from interface: WTCollection
Adds the given object to this collection. See WTCollection.add(Object) for documentation for this method.

Supported API: true

Specified by:
add in interface WTCollection
Parameters:
ref -
Returns:
true if the collection is modified as a result of this operation

add

public boolean add(Persistable p)
Description copied from interface: WTCollection
Adds the given object to this collection. See WTCollection.add(Object) for documentation for this method.

Supported API: true

Specified by:
add in interface WTCollection
Parameters:
p -
Returns:
true if the collections is modified as a result of this operation

add

public boolean add(QueryKey key)
Description copied from interface: WTCollection
Adds the given object to this collection. See WTCollection.add(Object) for documentation for this method.

Supported API: true

Specified by:
add in interface WTCollection
Parameters:
key -
Returns:
true if the collection is modified as a result of this operation

addAll

public boolean addAll(QueryResult queryResult)
Description copied from interface: WTCollection
Adds the contents of a QueryResult to this collection.

Supported API: true

Specified by:
addAll in interface WTCollection
Parameters:
queryResult -
Returns:
true if the operation modifies this collection

classIterator

public Iterator classIterator()
Description copied from interface: WTCollection
Returns an iterator over the classes that have instances in this collection. A remove() from the iterator removes all the instances of the class from the collection.

Supported API: true

Specified by:
classIterator in interface WTCollection
Returns:
An iterator of Class objects

clear

public void clear()
Specified by:
clear in interface Collection

connect

public boolean connect(WTReference ref,
                       WTCollection source)
Description copied from interface: WTCollection
Connects the given object from the source collection to this collection. When the object is inflated or refreshed in the source, it is also inflated or refreshed in this collection, and vice versa. If the object does not exist yet in this collection, then it is added to it. If the source collection does not contain the object, then it is simply added to this collection.

Supported API: false

Specified by:
connect in interface WTCollection
Parameters:
ref -
source -
Returns:
true If this collection was modified by the operation
See Also:
WTCollection.connect(WTReference,WTCollection,boolean)

connect

public boolean connect(Persistable p,
                       WTCollection source)
Description copied from interface: WTCollection
Connects the given object from the source collection to this collection. When the object is inflated or refreshed in the source, it is also inflated or refreshed in this collection, and vice versa. If the object does not exist yet in this collection, then it is added to it. If the source collection does not contain the object, then it is simply added to this collection.

Supported API: false

Specified by:
connect in interface WTCollection
Parameters:
p -
source -
Returns:
true If the object was added to the collection
See Also:
WTCollection.connect(Persistable,WTCollection,boolean)

connect

public boolean connect(QueryKey key,
                       WTCollection source)
Description copied from interface: WTCollection
Connects the given object from the source collection to this collection. When the object is inflated or refreshed in the source, it is also inflated or refreshed in this collection, and vice versa. If the object does not exist yet in this collection, then it is added to it. If the source collection does not contain the object, then it is simply added to this collection.

Supported API: false

Specified by:
connect in interface WTCollection
Parameters:
key -
source -
Returns:
true If this collection was modified by the operation
See Also:
WTCollection.connect(QueryKey,WTCollection,boolean)

connect

public boolean connect(WTReference ref,
                       WTCollection source,
                       boolean add_if_not_present)
Description copied from interface: WTCollection
Connects the given object from the source collection to this collection. When the object is inflated or refreshed in the source, it is also inflated or refreshed in this collection, and vice versa. If add_if_not_present is true, then if the object does not exist yet in this collection, it is added to it.

Supported API: true

Specified by:
connect in interface WTCollection
Parameters:
ref -
source -
add_if_not_present - When true, the object is added to this collection if it isn't currently contained by it.
Returns:
true If this collection was modified by the operation
See Also:
WTCollection.connect(WTReference,WTCollection,boolean)

connect

public boolean connect(Persistable p,
                       WTCollection source,
                       boolean add_if_not_present)
Description copied from interface: WTCollection
Connects the given object from the source collection to this collection. When the object is inflated or refreshed in the source, it is also inflated or refreshed in this collection, and vice versa. If add_if_not_present is true, then if the object does not exist yet in this collection, it is added to it.

Supported API: true

Specified by:
connect in interface WTCollection
Parameters:
p -
source -
add_if_not_present - When true, the object is added to this collection if it isn't currently contained by it.
Returns:
true If the object was added to the collection
See Also:
WTCollection.connect(Persistable,WTCollection,boolean)

connect

public boolean connect(QueryKey key,
                       WTCollection source,
                       boolean add_if_not_present)
Description copied from interface: WTCollection
Connects the given object from the source collection to this collection. When the object is inflated or refreshed in the source, it is also inflated or refreshed in this collection, and vice versa. If add_if_not_present is true, then if the object does not exist yet in this collection, it is added to it.

Supported API: true

Specified by:
connect in interface WTCollection
Parameters:
key -
source -
add_if_not_present - When true, the object is added to this collection if it isn't currently contained by it.
Returns:
true If this collection was modified by the operation
See Also:
WTCollection.connect(QueryKey,WTCollection,boolean)

connectAll

public boolean connectAll(WTCollection source)
Description copied from interface: WTCollection
Connects the elements in the source collection to this collection. When an object is inflated or refreshed in source, it is also inflated or refreshed in this collection, and vice versa. All of the objects in the source collection are added to this collection.

Supported API: false

Specified by:
connectAll in interface WTCollection
Parameters:
source -
Returns:
true If the operation modifies this collection.

connectAll

public boolean connectAll(WTCollection source,
                          boolean add_if_not_present)
Description copied from interface: WTCollection
Connects the elements in the source collection to this collection. When an object is inflated or refreshed in source, it is also inflated or refreshed in this collection, and vice versa. When add_if_not_present is true, all of the objects in the source collection are added to this collection.

Supported API: true

Specified by:
connectAll in interface WTCollection
Parameters:
source -
add_if_not_present - When true, objects in source that aren't currently in this collection are added to this collection.
Returns:
true If the operation modifies this collection.

connect

boolean connect(WTReference r,
                boolean add)

contains

public boolean contains(QueryKey key)
Description copied from interface: WTCollection
Determines if the collection contains the given object in some form. See WTCollection.contains(Object) for further documentation.

Supported API: true

Specified by:
contains in interface WTCollection
Parameters:
key -
Returns:
true if the collection contains this object

contains

public boolean contains(Object o)
Description copied from interface: WTCollection
Returns true if the collection contains the given QueryKey, WTReference, or Persistable, in any form. Thus if the collection contained only an ObjectIdentifier for an object, and the method is passed the oid's corresponding Persistable, then the result will be true.

Contains is overloaded with type-specific methods to allow callers to avoid the overhead of an instanceof check. The generic contains() delegates to the appropriate type-specific one.

Supported API: true

Specified by:
contains in interface WTCollection

contains

public boolean contains(Persistable p)
Description copied from interface: WTCollection
Determines if the collection contains the given object in some form. See WTCollection.contains(Object) for further documentation.

Supported API: true

Specified by:
contains in interface WTCollection
Parameters:
p -
Returns:
true if the collection contains this object

contains

public boolean contains(WTReference ref)
Description copied from interface: WTCollection
Determines if the collection contains the given object in some form. See WTCollection.contains(Object) for further documentation.

Supported API: true

Specified by:
contains in interface WTCollection
Parameters:
ref -
Returns:
true if the collection contains this object

containsAll

public boolean containsAll(Collection c)
Specified by:
containsAll in interface Collection

containsInstance

public boolean containsInstance(Class clazz)
Description copied from interface: WTCollection
Returns true if there is at least one object in the collection that the filter class is assignable from.

Supported API: true

Specified by:
containsInstance in interface WTCollection
Parameters:
clazz -
Returns:
boolean

containsOnly

public boolean containsOnly(Class clazz)
Description copied from interface: WTCollection
Determines whether this collection only contains objects that are assignable from the given filter.

Supported API: true

Specified by:
containsOnly in interface WTCollection
Parameters:
clazz -
Returns:
boolean

deflate

public void deflate()
Description copied from interface: WTCollection
Dereferences all Persistables in this collection that have QueryKeys. Also deflates any WTReferences in this collection. References to non-persisted Persistables are preserved.

Supported API: true

Specified by:
deflate in interface WTCollection

getKeyMask

public int getKeyMask()
Description copied from interface: WTCollection
Returns this collection's key mask. The key mask is a combination of the constants defined in CollectionsHelper.

Supported API: true

Specified by:
getKeyMask in interface WTCollection
Returns:
int
See Also:
CollectionsHelper.OBJECT_IDENTIFIER, CollectionsHelper.VERSION_FOREIGN_KEY

inflate

public void inflate()
             throws WTException
Description copied from interface: WTCollection
Retrieves the full persistables for any objects in this collection that currently only have QueryKeys or WTReferences. The WTReferences are inflated with the new object. Existing Persistables in the collection are not refreshed.

Supported API: true

Specified by:
inflate in interface WTCollection
Throws:
WTException

isDeflatedOnSerialization

public boolean isDeflatedOnSerialization()
Description copied from interface: WTCollection
Gets the value of the attribute: DEFLATED_ON_SERIALIZATION. When 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.

Supported API: false

Specified by:
isDeflatedOnSerialization in interface WTCollection
Returns:
boolean

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection

isEnabled

public boolean isEnabled(int mask)
Description copied from interface: WTCollection
Returns true if the key types in the given mask are enabled for this collection.

Supported API: true

Specified by:
isEnabled in interface WTCollection
Parameters:
mask -
Returns:
boolean
See Also:
WTCollection.getKeyMask()

iterator

public Iterator iterator()
Description copied from interface: WTCollection
Returns an iterator over the references in the collection, per the contract of the WTCollection.referenceIterator() API.

Supported API: true

Specified by:
iterator in interface WTCollection

persistableCollection

public Collection persistableCollection()
Description copied from interface: WTCollection
Provides a Persistable-based view of the objects in this WTCollection. This means the iterator method returns Persistables, and the contains and remove operations only work with Persistable arguments.

The resulting collection is backed by this collection, so changes to one are reflected in the other.

Supported API: true

Specified by:
persistableCollection in interface WTCollection
Returns:
A Collection of Persistables

persistableIterator

public Iterator persistableIterator()
                             throws WTException
Description copied from interface: WTCollection
Returns an iterator over the objects in this collection, as Persistables. Inflates all the QueryKeys and references in this collection that don't have Persistables yet. Persistables that are already in the collection are not refreshed.

Supported API: true

Specified by:
persistableIterator in interface WTCollection
Returns:
An iterator of Persistables
Throws:
WTException

persistableIterator

public Iterator persistableIterator(Class clazz,
                                    boolean param)
                             throws WTException
Description copied from interface: WTCollection
Refines persistableIterator() to only return objects that are either direct or descendent instances of the filter class, depending on the value of include_subclasses. Implementations should be optimized to return a shared empty iterator instance, if there are no matching objects in this collection.

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

Specified by:
persistableIterator in interface WTCollection
Parameters:
clazz -
param -
Returns:
An iterator of Persistables
Throws:
WTException
See Also:
WTCollection.persistableIterator()

queryKeyIterator

public Iterator queryKeyIterator()
Description copied from interface: WTCollection
Returns an iterator over the QueryKeys in this collection. These will typically be ObjectIdentifiers, but may be other QueryKey types depending on how the collection is constructed. Nonpersisted objects will not be included in the id iterator.

Supported API: true

Specified by:
queryKeyIterator in interface WTCollection
Returns:
An iterator of QueryKeys

queryKeyIterator

public Iterator queryKeyIterator(Class clazz,
                                 boolean param)
Description copied from interface: WTCollection
Refines queryKeyIterator() to only return keys that are either direct or descendent instances of the filter class, depending on the value of include_subclasses. Implementations should be optimized to return a shared empty iterator instance, if there are no matching objects in this collection.

Supported API: false

Specified by:
queryKeyIterator in interface WTCollection
Parameters:
clazz -
param -
Returns:
An iterator of QueryKeys
See Also:
WTCollection.queryKeyIterator()

referenceIterator

public Iterator referenceIterator()
Description copied from interface: WTCollection
Returns an Iterator over the objects in this collection, as WTReferences. The precise subclass of WTReference is determined by the referenced class, and by this collection's key mask. The references in the iterator may or may not be inflated, depending upon how they were added to the collection and when the collection was last refreshed. Non-persisted objects will still have references in the iterator; they will have null keys.

Supported API: true

Specified by:
referenceIterator in interface WTCollection
Returns:
An iterator of WTReferences

referenceIterator

public Iterator referenceIterator(Class clazz,
                                  boolean param)
Description copied from interface: WTCollection
Refines referenceIterator() to only return references that are either direct or descendent instances of the filter class, depending on the value of include_subclasses. Implementations should be optimized to return a shared empty iterator instance, if there are no matching objects in this collection.

Supported API: false

Specified by:
referenceIterator in interface WTCollection
Parameters:
clazz -
param -
Returns:
An iterator of WTReferences
See Also:
WTCollection.queryKeyIterator()

remove

public boolean remove(Persistable p)
Description copied from interface: WTCollection
Removes the object from this collection. See WTCollection.remove(Object) for further documentation. Removes the object from this collection. See WTCollection.remove(Object) for further documentation.

Supported API: true

Specified by:
remove in interface WTCollection
Parameters:
p -
Returns:
true if the operation modifies this collection

remove

public boolean remove(Object o)
Description copied from interface: WTCollection
Removes any form of the object in the collection. So if remove is passed a Persistable, but the collection only contained a QueryKey for the Persistable, that QueryKey is removed and the method returns true.

Remove is overloaded with type-specific methods to allow callers to avoid the overhead of an instanceof check. The generic remove() delegates to the appropriate type-specific one.

Supported API: true

Specified by:
remove in interface WTCollection

remove

public boolean remove(WTReference ref)
Description copied from interface: WTCollection
Removes the object from this collection. See WTCollection.remove(Object) for further documentation. See WTCollection.remove(Object) for further documentation.

Supported API: true

Specified by:
remove in interface WTCollection
Parameters:
ref -
Returns:
true if the operation modifies this collection

remove

public boolean remove(QueryKey key)
Description copied from interface: WTCollection
Removes the object from this collection. See WTCollection.remove(Object) for further documentation. See WTCollection.remove(Object) for further documentation.

Supported API: true

Specified by:
remove in interface WTCollection
Parameters:
key -
Returns:
true if the operation modifies this collection

removeAll

public boolean removeAll(Class clazz,
                         boolean param)
Description copied from interface: WTCollection
Removes all objects in this collection that are assignable from the given class.

Supported API: true

Specified by:
removeAll in interface WTCollection
Parameters:
clazz -
param -
Returns:
true if the operation modifies this collection

retainAll

public boolean retainAll(Class clazz,
                         boolean param)
Description copied from interface: WTCollection
Removes all objects in this collection that are not assignable from the given class.

Supported API: true

Specified by:
retainAll in interface WTCollection
Parameters:
clazz -
param -
Returns:
true if the operation modifies this collection

setDeflatedOnSerialization

public void setDeflatedOnSerialization(boolean param)
                                throws WTPropertyVetoException
Description copied from interface: WTCollection
Sets the value of the attribute: DEFLATED_ON_SERIALIZATION. When 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.

Supported API: false

Specified by:
setDeflatedOnSerialization in interface WTCollection
Parameters:
param -
Throws:
WTPropertyVetoException

size

public int size()
Specified by:
size in interface Collection

subCollection

public WTCollection subCollection(Class clazz)
Description copied from interface: WTCollection
Returns a WTCollection containing the objects in this collection that are assignable from the given filter class. See WTCollection.subCollection(Class, boolean) for further documentation.

Supported API: false

Specified by:
subCollection in interface WTCollection
Parameters:
clazz -
Returns:
A WTCollection of the same interface type as this WTCollection. For example, if this collection is a WTSet, then the subcollection will also be a WTSet.

subCollection

public WTCollection subCollection(Class clazz,
                                  boolean param)
Description copied from interface: WTCollection
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. The resulting collection is backed by this collection; modifications to one are reflected in the other. Refreshes to the subcollection should not result in the refresh of the entire collection.

Supported API: true

Specified by:
subCollection in interface WTCollection
Parameters:
clazz -
param -
Returns:
A WTCollection of the same interface type as this WTCollection. For example, if this collection is a WTSet, then the subcollection will also be a WTSet.

toArray

public Object[] toArray()
Description copied from interface: WTCollection
Returns an object array filled with WTReferences to all the objects in this collection.

Supported API: true

Specified by:
toArray in interface WTCollection

toArray

public long[] toArray(long[] values)
Description copied from interface: WTCollection
Fills the given array with the long ids from each QueryKey in this collection.

Supported API: true

Specified by:
toArray in interface WTCollection
Parameters:
values -
Returns:
long[]

toArray

public Object[] toArray(Object[] a)
Description copied from interface: WTCollection
Fills the given array with the objects in this collection. If the array is of type Persistable[], QueryKey[], or WTReference[], then the corresponding type-specific toArray() is called. Otherwise the array is filled with WTReferences.

Supported API: true

Specified by:
toArray in interface WTCollection

toArray

public WTReference[] toArray(WTReference[] ref)
Description copied from interface: WTCollection
Fills the given array with WTReferences to all the objects in this collection.

Supported API: true

Specified by:
toArray in interface WTCollection
Parameters:
ref -
Returns:
WTReference[]

toArray

public QueryKey[] toArray(QueryKey[] key)
Description copied from interface: WTCollection
Fills the given array with the QueryKeys in this collection.

Supported API: true

Specified by:
toArray in interface WTCollection
Parameters:
key -
Returns:
QueryKey[]

toArray

public Persistable[] toArray(Persistable[] p)
Description copied from interface: WTCollection
Fills the given array with the Persistables in this collection. Inflates all QueryKeys in the collection that don't yet have corresponding Persistables.

Supported API: true

Specified by:
toArray in interface WTCollection
Parameters:
p -
Returns:
Persistable[]

toIdArray

public long[] toIdArray()
Description copied from interface: WTCollection
Returns an array with the long ids from each QueryKey in this collection.

Supported API: true

Specified by:
toIdArray in interface WTCollection
Returns:
long[]

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection

toString

public String toString()

getReference

public WTReference getReference(WTReference r)
Description copied from interface: ReferenceBased
Get a reference used internally by this collection that refers to the same object as the given reference. If there is more than one matching reference, then the particular reference that is returned is arbitrary

Supported API: false

Specified by:
getReference in interface ReferenceBased
Parameters:
r -
Returns:
WTReference

getReference

public WTReference getReference(QueryKey q)
Description copied from interface: ReferenceBased
Get a reference used internally by this collection that refers to the given key. If there is more than one matching reference, then the particular reference that is returned is arbitrary

Supported API: false

Specified by:
getReference in interface ReferenceBased
Parameters:
q -
Returns:
WTReference

getReference

public WTReference getReference(Persistable p)
Description copied from interface: ReferenceBased
Get a reference used internally by this collection that refers to the given Persistable. If there is more than one matching reference, then the particular reference that is returned is arbitrary

Supported API: false

Specified by:
getReference in interface ReferenceBased
Parameters:
p -
Returns:
WTReference

getReferences

public WTReference[] getReferences(WTReference r)
Description copied from interface: ReferenceBased
Get all the references used internally by this collection that refers to the given reference. This is used by the default implementation of inflate.

Supported API: false

Specified by:
getReferences in interface ReferenceBased
Parameters:
r -
Returns:
WTReference[]