wt.fc.collections
Interface WTList

All Superinterfaces:
Collection, List, WTCollection
All Known Implementing Classes:
AbstractWTList, EmptyCollections.EmptyList, SynchronizedCollections.SynchronizedWTList, UnmodifiableCollections.UnmodifiableList

public interface WTList
extends WTCollection, List

A WTCollection that implements the java.util.List interface.

Supported API: true

Extendable: false


Field Summary
 
Fields inherited from interface wt.fc.collections.WTCollection
DEFLATED_ON_SERIALIZATION
 
Method Summary
 void add(int index, Object o)
          Adds the given object at the given index.
 void add(int index, Persistable p)
          Adds the given object at the given index.
 void add(int index, QueryKey query_key)
          Adds the given object at the given index.
 void add(int index, WTReference ref)
          Adds the given object at the given index.
 boolean addAll(int index, Collection c)
          Adds the given collection of objects at the given index.
 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 query_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(QueryKey query_key, WTCollection source)
          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 connectAll(int index, WTCollection c)
          Connects the objects in the source collection to this collection, starting at the given index.
 Object get(int index)
          Gets the WTReference at the specified index.
 Persistable getPersistable(int index)
          Gets the Persistable at the specified index.
 QueryKey getQueryKey(int index)
          Gets the QueryKey at the specified index.
 WTReference getReference(int index)
          Gets the WTReference at the specified index.
 int indexOf(Persistable p)
          Gets the index of the given object.
 int indexOf(QueryKey query_key)
          Gets the index of the given object.
 int indexOf(WTReference ref)
          Gets the index of the given object.
 int lastIndexOf(Persistable p)
          Gets the last index of the given object.
 int lastIndexOf(QueryKey query_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).
 ListIterator persistableListIterator()
          Returns a ListIterator over the Persistables in this list.
 ListIterator persistableListIterator(int index)
          Returns a ListIterator over the Persistables in this list, starting at the given index.
 ListIterator queryKeyListIterator()
          Returns a ListIterator over the QueryKeys in this list.
 ListIterator queryKeyListIterator(int index)
          Returns a ListIterator over the QueryKeys in this list, starting at the given index.
 ListIterator referenceListIterator()
          Returns a ListIterator over the WTReferences in this list.
 ListIterator referenceListIterator(int index)
          Returns a ListIterator over the WTReferences in this list, starting at the given index.
 Object set(int index, Object o)
          Assigns the object to the given index.
 Persistable set(int index, Persistable p)
          Sets the object at the given index.
 QueryKey set(int index, QueryKey query_key)
          Sets the object at the given index.
 WTReference set(int index, WTReference ref)
          Sets the object at the given index.
 List subList(int from_index, int to_index)
          Returns a sublist of backed by this WTList, per the contract of List.subList(int,int)

Supported API: true
 
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, indexOf, isEmpty, iterator, lastIndexOf, remove, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

add

public void add(int index,
                Object o)
Adds the given object at the given index. See WTCollection.add(Object) for further documentation

Supported API: true

Specified by:
add in interface List
Parameters:
index -
o -

add

public void add(int index,
                Persistable p)
Adds the given object at the given index. See WTCollection.add(Object) for further documentation

Supported API: true

Parameters:
index -
p -

add

public void add(int index,
                QueryKey query_key)
Adds the given object at the given index. See WTCollection.add(Object) for further documentation

Supported API: true

Parameters:
index -
query_key -

add

public void add(int index,
                WTReference ref)
Adds the given object at the given index. See WTCollection.add(Object) for further documentation

Supported API: true

Parameters:
index -
ref -

addAll

public boolean addAll(int index,
                      Collection c)
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 List
Parameters:
index -
c -
Returns:
boolean

connect

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

Supported API: true

Parameters:
index -
p -
source -
See Also:
WTCollection.connect(Persistable, WTCollection)

connect

public void connect(int index,
                    QueryKey query_key,
                    WTCollection source)
Connects the given object from the source collection to this collection, at the given index.

Supported API: true

Parameters:
index -
query_key -
source -
See Also:
WTCollection.connect(Persistable, WTCollection)

connect

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

Supported API: true

Parameters:
index -
ref -
source -
See Also:
WTCollection.connect(Persistable, WTCollection)

connectAll

public boolean connectAll(int index,
                          WTCollection c)
Connects the objects in the source collection to this collection, starting at the given index.

Supported API: true

Parameters:
index -
c -
Returns:
true If this operation modifies the collection
See Also:
WTCollection.connectAll(WTCollection)

get

public Object get(int index)
Gets the WTReference at the specified index.

Supported API: true

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

getPersistable

public Persistable getPersistable(int index)
                           throws WTException
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

Parameters:
index -
Returns:
A Persistable
Throws:
WTException

getQueryKey

public QueryKey getQueryKey(int index)
Gets the QueryKey at the specified index.

Supported API: true

Parameters:
index -
Returns:
A QueryKey

getReference

public WTReference getReference(int index)
Gets the WTReference at the specified index.

Supported API: true

Parameters:
index -
Returns:
A WTReference

indexOf

public int indexOf(QueryKey query_key)
Gets the index of the given object.

Supported API: true

Parameters:
query_key -
Returns:
int
See Also:
List.indexOf(Object)

indexOf

public int indexOf(Persistable p)
Gets the index of the given object.

Supported API: true

Parameters:
p -
Returns:
int
See Also:
List.indexOf(Object)

indexOf

public int indexOf(WTReference ref)
Gets the index of the given object.

Supported API: true

Parameters:
ref -
Returns:
int
See Also:
List.indexOf(Object)

lastIndexOf

public int lastIndexOf(QueryKey query_key)
Gets the last index of the given object.

Supported API: true

Parameters:
query_key -
Returns:
int
See Also:
List.lastIndexOf(Object)

lastIndexOf

public int lastIndexOf(Persistable p)
Gets the last index of the given object.

Supported API: true

Parameters:
p -
Returns:
int
See Also:
List.lastIndexOf(Object)

lastIndexOf

public int lastIndexOf(WTReference ref)
Gets the last index of the given object.

Supported API: true

Parameters:
ref -
Returns:
int
See Also:
List.lastIndexOf(Object)

listIterator

public ListIterator listIterator()
Returns a ListIterator over the WTReferences in this list, per the contract of referenceListIterator().

Supported API: true

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

listIterator

public ListIterator listIterator(int index)
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 List
Parameters:
index -
Returns:
A ListIterator of WTReferences

persistableListIterator

public ListIterator persistableListIterator()
                                     throws WTException
Returns a ListIterator over the Persistables in this list. Refreshes the collection in the same manner as WTCollection.persistableIterator().

Supported API: true

Returns:
A ListIterator of Persistables
Throws:
WTException

persistableListIterator

public ListIterator persistableListIterator(int index)
                                     throws WTException
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

Parameters:
index -
Returns:
A ListIterator of Persistables
Throws:
WTException

queryKeyListIterator

public ListIterator queryKeyListIterator()
Returns a ListIterator over the QueryKeys in this list.

Supported API: true

Returns:
A ListIterator of QueryKeys

queryKeyListIterator

public ListIterator queryKeyListIterator(int index)
Returns a ListIterator over the QueryKeys in this list, starting at the given index.

Supported API: true

Parameters:
index -
Returns:
A ListIterator of QueryKeys

referenceListIterator

public ListIterator referenceListIterator()
Returns a ListIterator over the WTReferences in this list.

Supported API: true

Returns:
A ListIterator of WTReferences

referenceListIterator

public ListIterator referenceListIterator(int index)
Returns a ListIterator over the WTReferences in this list, starting at the given index.

Supported API: true

Parameters:
index -
Returns:
A ListIterator of WTReferences

set

public Object set(int index,
                  Object o)
Assigns the object to the given index.

Supported API: true

Specified by:
set in interface List
Parameters:
index -
o -
Returns:
Object
Throws:
ClassCastException - per the constraints of WTCollection.add(Object)

set

public Persistable set(int index,
                       Persistable p)
Sets the object at the given index. See set(int, Object) for further documentation.

Supported API: true

Parameters:
index -
p -
Returns:
Persistable

set

public QueryKey set(int index,
                    QueryKey query_key)
Sets the object at the given index. See set(int, Object) for further documentation.

Supported API: true

Parameters:
index -
query_key -
Returns:
QueryKey

set

public WTReference set(int index,
                       WTReference ref)
Sets the object at the given index. See set(int, Object) for further documentation.

Supported API: true

Parameters:
index -
ref -
Returns:
WTReference

subList

public List subList(int from_index,
                    int to_index)
Returns a sublist of backed by this WTList, per the contract of List.subList(int,int)

Supported API: true

Specified by:
subList in interface List
Parameters:
from_index -
to_index -
Returns:
An implementation of WTList

connect

public boolean connect(Persistable p,
                       WTCollection source)
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
Throws:
IllegalArgumentException - If the source does not have the same key type as this collection
ClassCastException - If this collection does not support connection with the source's implementation of WTCollection.
See Also:
WTCollection.add(Object)

connect

public boolean connect(QueryKey query_key,
                       WTCollection source)
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:
query_key -
source -
Returns:
true If the object was added to the collection
Throws:
IllegalArgumentException - If the source does not have the same key type as this collection
ClassCastException - If this collection does not support connection with the source's implementation of WTCollection.
See Also:
WTCollection.add(Object)

connect

public boolean connect(WTReference ref,
                       WTCollection source)
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 the object was added to the collection
Throws:
IllegalArgumentException - If the source does not have the same key type as this collection
ClassCastException - If this collection does not support connection with the source's implementation of WTCollection.
See Also:
WTCollection.add(Object)