wt.fc.collections
Class EmptyCollections.EmptyList

java.lang.Object
  extended byjava.util.AbstractCollection
      extended bywt.fc.collections.EmptyCollections.EmptyCollection
          extended bywt.fc.collections.EmptyCollections.EmptyList
All Implemented Interfaces:
Collection, List, ReferenceBased, Serializable, WTCollection, WTList
Enclosing class:
EmptyCollections

static class EmptyCollections.EmptyList
extends EmptyCollections.EmptyCollection
implements WTList


Field Summary
 
Fields inherited from interface wt.fc.collections.WTCollection
DEFLATED_ON_SERIALIZATION
 
Constructor Summary
(package private) EmptyCollections.EmptyList()
           
 
Method Summary
 void add(int param, Object object)
          Adds the given object at the given index.
 void add(int param, Persistable p)
          Adds the given object at the given index.
 void add(int param, QueryKey key)
          Adds the given object at the given index.
 void add(int param, WTReference ref)
          Adds the given object at the given index.
 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(int param, Collection collection)
          Adds the given collection of objects at the given index.
 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()
           
 void connect(int index, Persistable p, WTCollection source)
          Connects the given object from the source collection to this collection, at the given index.
 void connect(int index, QueryKey key, WTCollection source)
          Connects the given object from the source collection to this collection, at the given index.
 void connect(int index, WTReference ref, WTCollection source)
          Connects the given object from the source collection to this collection, at the given index.
 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(int index, WTCollection source)
          Connects the objects in the source collection to this collection, starting at the given index.
 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.
 Object get(int index)
          Gets the WTReference at the specified index.
 int getKeyMask()
          Returns this collection's key mask.
 Persistable getPersistable(int param)
          Gets the Persistable at the specified index.
 QueryKey getQueryKey(int param)
          Gets the QueryKey at the specified index.
 WTReference getReference(int param)
          Gets the WTReference at the specified index.
 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 indexOf(Object o)
           
 int indexOf(Persistable p)
          Gets the index of the given object.
 int indexOf(QueryKey key)
          Gets the index of the given object.
 int indexOf(WTReference ref)
          Gets the index of the given object.
 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 EmptyCollections.EmptyCollection.referenceIterator() API.
 int lastIndexOf(Object o)
           
 int lastIndexOf(Persistable p)
          Gets the last index of the given object.
 int lastIndexOf(QueryKey key)
          Gets the last index of the given object.
 int lastIndexOf(WTReference ref)
          Gets the last index of the given object.
 ListIterator listIterator()
          Returns a ListIterator over the WTReferences in this list, per the contract of referenceListIterator().
 ListIterator listIterator(int index)
          Returns a ListIterator over the WTReferences in this list starting at the given index, per the contract of referenceListIterator(int).
 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.
 ListIterator persistableListIterator()
          Returns a ListIterator over the Persistables in this list.
 ListIterator persistableListIterator(int param)
          Returns a ListIterator over the Persistables in this list, starting at the given index.
 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.
 ListIterator queryKeyListIterator()
          Returns a ListIterator over the QueryKeys in this list.
 ListIterator queryKeyListIterator(int param)
          Returns a ListIterator over the QueryKeys in this list, starting at the given index.
private  Object readResolve()
           
 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.
 ListIterator referenceListIterator()
          Returns a ListIterator over the WTReferences in this list.
 ListIterator referenceListIterator(int param)
          Returns a ListIterator over the WTReferences in this list, starting at the given index.
 Object remove(int index)
           
 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.
 Object set(int index, Object element)
          Assigns the object to the given index.
 Persistable set(int param, Persistable p)
          Sets the object at the given index.
 QueryKey set(int param, QueryKey key)
          Sets the object at the given index.
 WTReference set(int param, WTReference ref)
          Sets the object at the given index.
 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.
 List subList(int fromIndex, int toIndex)
          Returns a sublist of backed by this WTList, per the contract of List.subList(int,int)

Supported API: true
 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.
 
Methods inherited from class java.util.AbstractCollection
add, addAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wt.fc.collections.WTList
connect, connect, connect
 
Methods inherited from interface wt.fc.collections.WTCollection
add, add, add, add, addAll, addAll, classIterator, connect, connect, connect, connectAll, connectAll, contains, contains, contains, contains, containsInstance, containsOnly, deflate, getKeyMask, inflate, isDeflatedOnSerialization, isEnabled, iterator, persistableCollection, persistableIterator, persistableIterator, queryKeyIterator, queryKeyIterator, referenceIterator, referenceIterator, remove, remove, remove, remove, removeAll, retainAll, setDeflatedOnSerialization, subCollection, subCollection, toArray, toArray, toArray, toArray, toArray, toArray, toIdArray
 
Methods inherited from interface java.util.Collection
clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, size
 
Methods inherited from interface java.util.List
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

EmptyCollections.EmptyList

EmptyCollections.EmptyList()
Method Detail

add

public void add(int param,
                Object object)
Description copied from interface: WTList
Adds the given object at the given index. See WTCollection.add(Object) for further documentation

Supported API: true

Specified by:
add in interface WTList
Parameters:
param -
object -

add

public void add(int param,
                WTReference ref)
Description copied from interface: WTList
Adds the given object at the given index. See WTCollection.add(Object) for further documentation

Supported API: true

Specified by:
add in interface WTList
Parameters:
param -
ref -

add

public void add(int param,
                Persistable p)
Description copied from interface: WTList
Adds the given object at the given index. See WTCollection.add(Object) for further documentation

Supported API: true

Specified by:
add in interface WTList
Parameters:
param -
p -

add

public void add(int param,
                QueryKey key)
Description copied from interface: WTList
Adds the given object at the given index. See WTCollection.add(Object) for further documentation

Supported API: true

Specified by:
add in interface WTList
Parameters:
param -
key -

addAll

public boolean addAll(int param,
                      Collection collection)
Description copied from interface: WTList
Adds the given collection of objects at the given index. See WTCollection.add(Object) for further documentation

Supported API: true

Specified by:
addAll in interface WTList
Parameters:
param -
collection -
Returns:
boolean

connect

public void connect(int index,
                    WTReference ref,
                    WTCollection source)
Description copied from interface: WTList
Connects the given object from the source collection to this collection, at the given index.

Supported API: true

Specified by:
connect in interface WTList
Parameters:
index -
ref -
source -
See Also:
WTCollection.connect(Persistable, WTCollection)

connect

public void connect(int index,
                    Persistable p,
                    WTCollection source)
Description copied from interface: WTList
Connects the given object from the source collection to this collection, at the given index.

Supported API: true

Specified by:
connect in interface WTList
Parameters:
index -
p -
source -
See Also:
WTCollection.connect(Persistable, WTCollection)

connect

public void connect(int index,
                    QueryKey key,
                    WTCollection source)
Description copied from interface: WTList
Connects the given object from the source collection to this collection, at the given index.

Supported API: true

Specified by:
connect in interface WTList
Parameters:
index -
key -
source -
See Also:
WTCollection.connect(Persistable, WTCollection)

connectAll

public boolean connectAll(int index,
                          WTCollection source)
Description copied from interface: WTList
Connects the objects in the source collection to this collection, starting at the given index.

Supported API: true

Specified by:
connectAll in interface WTList
Parameters:
index -
source -
Returns:
true If this operation modifies the collection
See Also:
WTCollection.connectAll(WTCollection)

get

public Object get(int index)
Description copied from interface: WTList
Gets the WTReference at the specified index.

Supported API: true

Specified by:
get in interface WTList
Parameters:
index -
Returns:
A WTReference

getPersistable

public Persistable getPersistable(int param)
Description copied from interface: WTList
Gets the Persistable at the specified index. If the Persistable is not inflated, this method will go to the database to get it. Implementations may choose to have this cause an inflate of the entire list.

Supported API: true

Specified by:
getPersistable in interface WTList
Parameters:
param -
Returns:
A Persistable

getQueryKey

public QueryKey getQueryKey(int param)
Description copied from interface: WTList
Gets the QueryKey at the specified index.

Supported API: true

Specified by:
getQueryKey in interface WTList
Parameters:
param -
Returns:
A QueryKey

getReference

public WTReference getReference(int param)
Description copied from interface: WTList
Gets the WTReference at the specified index.

Supported API: true

Specified by:
getReference in interface WTList
Parameters:
param -
Returns:
A WTReference

indexOf

public int indexOf(Persistable p)
Description copied from interface: WTList
Gets the index of the given object.

Supported API: true

Specified by:
indexOf in interface WTList
Parameters:
p -
Returns:
int
See Also:
List.indexOf(Object)

indexOf

public int indexOf(QueryKey key)
Description copied from interface: WTList
Gets the index of the given object.

Supported API: true

Specified by:
indexOf in interface WTList
Parameters:
key -
Returns:
int
See Also:
List.indexOf(Object)

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List

indexOf

public int indexOf(WTReference ref)
Description copied from interface: WTList
Gets the index of the given object.

Supported API: true

Specified by:
indexOf in interface WTList
Parameters:
ref -
Returns:
int
See Also:
List.indexOf(Object)

lastIndexOf

public int lastIndexOf(QueryKey key)
Description copied from interface: WTList
Gets the last index of the given object.

Supported API: true

Specified by:
lastIndexOf in interface WTList
Parameters:
key -
Returns:
int
See Also:
List.lastIndexOf(Object)

lastIndexOf

public int lastIndexOf(Persistable p)
Description copied from interface: WTList
Gets the last index of the given object.

Supported API: true

Specified by:
lastIndexOf in interface WTList
Parameters:
p -
Returns:
int
See Also:
List.lastIndexOf(Object)

lastIndexOf

public int lastIndexOf(WTReference ref)
Description copied from interface: WTList
Gets the last index of the given object.

Supported API: true

Specified by:
lastIndexOf in interface WTList
Parameters:
ref -
Returns:
int
See Also:
List.lastIndexOf(Object)

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List

listIterator

public ListIterator listIterator()
Description copied from interface: WTList
Returns a ListIterator over the WTReferences in this list, per the contract of referenceListIterator().

Supported API: true

Specified by:
listIterator in interface WTList
Returns:
A ListIterator of WTReferences

listIterator

public ListIterator listIterator(int index)
Description copied from interface: WTList
Returns a ListIterator over the WTReferences in this list starting at the given index, per the contract of referenceListIterator(int).

Supported API: true

Specified by:
listIterator in interface WTList
Parameters:
index -
Returns:
A ListIterator of WTReferences

persistableListIterator

public ListIterator persistableListIterator()
Description copied from interface: WTList
Returns a ListIterator over the Persistables in this list. Refreshes the collection in the same manner as WTCollection.persistableIterator().

Supported API: true

Specified by:
persistableListIterator in interface WTList
Returns:
A ListIterator of Persistables

persistableListIterator

public ListIterator persistableListIterator(int param)
Description copied from interface: WTList
Returns a ListIterator over the Persistables in this list, starting at the given index. Refreshes the collection in the same manner as WTCollection.persistableIterator().

Supported API: true

Specified by:
persistableListIterator in interface WTList
Parameters:
param -
Returns:
A ListIterator of Persistables

queryKeyListIterator

public ListIterator queryKeyListIterator()
Description copied from interface: WTList
Returns a ListIterator over the QueryKeys in this list.

Supported API: true

Specified by:
queryKeyListIterator in interface WTList
Returns:
A ListIterator of QueryKeys

queryKeyListIterator

public ListIterator queryKeyListIterator(int param)
Description copied from interface: WTList
Returns a ListIterator over the QueryKeys in this list, starting at the given index.

Supported API: true

Specified by:
queryKeyListIterator in interface WTList
Parameters:
param -
Returns:
A ListIterator of QueryKeys

referenceListIterator

public ListIterator referenceListIterator()
Description copied from interface: WTList
Returns a ListIterator over the WTReferences in this list.

Supported API: true

Specified by:
referenceListIterator in interface WTList
Returns:
A ListIterator of WTReferences

referenceListIterator

public ListIterator referenceListIterator(int param)
Description copied from interface: WTList
Returns a ListIterator over the WTReferences in this list, starting at the given index.

Supported API: true

Specified by:
referenceListIterator in interface WTList
Parameters:
param -
Returns:
A ListIterator of WTReferences

remove

public Object remove(int index)
Specified by:
remove in interface List

set

public WTReference set(int param,
                       WTReference ref)
Description copied from interface: WTList
Sets the object at the given index. See WTList.set(int, Object) for further documentation.

Supported API: true

Specified by:
set in interface WTList
Parameters:
param -
ref -
Returns:
WTReference

set

public QueryKey set(int param,
                    QueryKey key)
Description copied from interface: WTList
Sets the object at the given index. See WTList.set(int, Object) for further documentation.

Supported API: true

Specified by:
set in interface WTList
Parameters:
param -
key -
Returns:
QueryKey

set

public Object set(int index,
                  Object element)
Description copied from interface: WTList
Assigns the object to the given index.

Supported API: true

Specified by:
set in interface WTList
Parameters:
index -
element -
Returns:
Object

set

public Persistable set(int param,
                       Persistable p)
Description copied from interface: WTList
Sets the object at the given index. See WTList.set(int, Object) for further documentation.

Supported API: true

Specified by:
set in interface WTList
Parameters:
param -
p -
Returns:
Persistable

subList

public List subList(int fromIndex,
                    int toIndex)
Description copied from interface: WTList
Returns a sublist of backed by this WTList, per the contract of List.subList(int,int)

Supported API: true

Specified by:
subList in interface WTList
Parameters:
fromIndex -
toIndex -
Returns:
An implementation of WTList

readResolve

private Object readResolve()

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.

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()
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

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()
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

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[]

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[]