wt.fc.collections
Class WTArrayList.OffSetList

java.lang.Object
  extended byjava.util.AbstractCollection
      extended bywt.fc.collections.AbstractWTCollection
          extended bywt.fc.collections.AbstractWTList
              extended bywt.fc.collections.WTArrayList.OffSetList
All Implemented Interfaces:
Collection, List, ReferenceBased, Serializable, WTCollection, WTList
Enclosing class:
WTArrayList

static class WTArrayList.OffSetList
extends AbstractWTList
implements Serializable


Nested Class Summary
(package private)  class WTArrayList.OffSetList.OffsetIterator
           
 
Nested classes inherited from class wt.fc.collections.AbstractWTList
 
Nested classes inherited from class wt.fc.collections.AbstractWTCollection
AbstractWTCollection.PersistableCollection
 
Field Summary
(package private)  int expectedModCount
           
(package private)  ReferenceMap map
           
(package private)  int offset
           
(package private)  AbstractWTList source
           
 
Fields inherited from class wt.fc.collections.AbstractWTList
 
Fields inherited from class wt.fc.collections.AbstractWTCollection
 
Fields inherited from interface wt.fc.collections.WTCollection
DEFLATED_ON_SERIALIZATION
 
Constructor Summary
(package private) WTArrayList.OffSetList(AbstractWTList a_Source, int from_index, int to_index)
           
 
Method Summary
 void add(int index, WTReference ref)
          

Supported API: false
 Iterator classIterator()
          Returns an iterator over the classes that have instances in this collection.
 void connect(int index, WTReference ref, WTCollection c)
          

Supported API: false
 boolean containsInstance(Class filter)
          Returns true if there is at least one object in the collection that the filter class is assignable from.
 int getKeyMask()
          Returns this collection's key mask.
(package private)  int getModCount()
           
 Persistable getPersistable(int index)
          

Supported API: false
 QueryKey getQueryKey(int index)
          

Supported API: false
 WTReference getReference(int index)
          

Supported API: false
 boolean isDeflatedOnSerialization()
          Gets the value of the attribute: DEFLATED_ON_SERIALIZATION.
private  void modCheck()
           
 Iterator persistableIterator()
          Returns an iterator over the objects in this collection, as Persistables.
 Iterator persistableIterator(Class filter, boolean include_subclasses)
          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(int index)
          

Supported API: false
 Iterator queryKeyIterator()
          Returns an iterator over the QueryKeys in this collection.
 Iterator queryKeyIterator(Class filter, boolean include_subclasses)
          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(int index)
          

Supported API: false
private  void rangeCheck(int index)
           
(package private)  void referenceAdded(WTReference r)
           
 Iterator referenceIterator()
          Returns an Iterator over the objects in this collection, as WTReferences.
 Iterator referenceIterator(Class filter, boolean include_subclasses)
          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(int index)
          

Supported API: false
(package private)  void referenceRemoved(WTReference r)
           
 Object remove(int index)
          

Supported API: false
 WTReference set(int index, WTReference ref)
          

Supported API: false
 int size()
           
 WTCollection subCollection(Class filter, boolean include_subclasses)
          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)
          

Supported API: false
(package private)  Object writeReplace()
          Externalize as a plain WTArrayList
 
Methods inherited from class wt.fc.collections.AbstractWTList
add, add, add, add, add, add, addAll, addAll, connect, connect, connect, connectAll, equals, get, indexOf, indexOf, indexOf, indexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, listIterator, listIterator, persistableListIterator, queryKeyListIterator, referenceListIterator, set, set, set
 
Methods inherited from class wt.fc.collections.AbstractWTCollection
add, addAll, connect, connect, connect, connect, connect, connect, connectAll, connectAll, contains, contains, contains, contains, containsNonPersisted, containsOnly, deflate, getIteratorListener, getLastReturnedReference, getReference, getReference, getReference, getReferences, hashCode, inflate, isEnabled, iterator, persistableCollection, remove, remove, remove, remove, removeAll, removeNonPersisted, retainAll, setDeflatedOnSerialization, setLastReturnedReference, subCollection, toArray, toArray, toArray, toArray, toArray, toArray, toIdArray
 
Methods inherited from class java.util.AbstractCollection
clear, containsAll, isEmpty, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, 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, addAll, connect, connect, connect, connectAll, connectAll, contains, contains, contains, contains, containsOnly, deflate, inflate, isEnabled, iterator, persistableCollection, remove, remove, remove, remove, removeAll, retainAll, setDeflatedOnSerialization, subCollection, toArray, toArray, toArray, toArray, toArray, toArray, toIdArray
 
Methods inherited from interface java.util.Collection
clear, containsAll, hashCode, isEmpty, removeAll, retainAll
 
Methods inherited from interface java.util.List
add, clear, contains, containsAll, hashCode, isEmpty, iterator, remove, removeAll, retainAll, toArray, toArray
 

Field Detail

source

AbstractWTList source

offset

int offset

expectedModCount

int expectedModCount

map

ReferenceMap map
Constructor Detail

WTArrayList.OffSetList

WTArrayList.OffSetList(AbstractWTList a_Source,
                       int from_index,
                       int to_index)
Method Detail

writeReplace

Object writeReplace()
              throws ObjectStreamException
Externalize as a plain WTArrayList

Throws:
ObjectStreamException

rangeCheck

private void rangeCheck(int index)

modCheck

private void modCheck()

referenceAdded

void referenceAdded(WTReference r)
Overrides:
referenceAdded in class AbstractWTCollection

referenceRemoved

void referenceRemoved(WTReference r)
Overrides:
referenceRemoved in class AbstractWTCollection

add

public void add(int index,
                WTReference ref)
Description copied from class: AbstractWTList


Supported API: false

Specified by:
add in interface WTList
Overrides:
add in class AbstractWTList
Parameters:
index -
ref -

connect

public void connect(int index,
                    WTReference ref,
                    WTCollection c)
Description copied from class: AbstractWTList


Supported API: false

Specified by:
connect in interface WTList
Overrides:
connect in class AbstractWTList
Parameters:
index -
ref -
c -

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
Specified by:
classIterator in class AbstractWTCollection
Returns:
Iterator

containsInstance

public boolean containsInstance(Class filter)
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
Overrides:
containsInstance in class AbstractWTCollection
Parameters:
filter -
Returns:
boolean

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
Specified by:
getKeyMask in class AbstractWTCollection
Returns:
int

getPersistable

public Persistable getPersistable(int index)
                           throws WTException
Description copied from class: AbstractWTList


Supported API: false

Specified by:
getPersistable in interface WTList
Overrides:
getPersistable in class AbstractWTList
Parameters:
index -
Returns:
Persistable
Throws:
WTException

getQueryKey

public QueryKey getQueryKey(int index)
Description copied from class: AbstractWTList


Supported API: false

Specified by:
getQueryKey in interface WTList
Overrides:
getQueryKey in class AbstractWTList
Parameters:
index -
Returns:
QueryKey

getReference

public WTReference getReference(int index)
Description copied from class: AbstractWTList


Supported API: false

Specified by:
getReference in interface WTList
Overrides:
getReference in class AbstractWTList
Parameters:
index -
Returns:
WTReference

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
Overrides:
isDeflatedOnSerialization in class AbstractWTCollection
Returns:
boolean

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
Specified by:
persistableIterator in class AbstractWTCollection
Returns:
Iterator
Throws:
WTException

persistableIterator

public Iterator persistableIterator(Class filter,
                                    boolean include_subclasses)
                             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
Specified by:
persistableIterator in class AbstractWTCollection
Parameters:
filter -
include_subclasses -
Returns:
Iterator
Throws:
WTException

persistableListIterator

public ListIterator persistableListIterator(int index)
                                     throws WTException
Description copied from class: AbstractWTList


Supported API: false

Specified by:
persistableListIterator in interface WTList
Specified by:
persistableListIterator in class AbstractWTList
Parameters:
index -
Returns:
ListIterator
Throws:
WTException

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
Specified by:
queryKeyIterator in class AbstractWTCollection
Returns:
Iterator

queryKeyIterator

public Iterator queryKeyIterator(Class filter,
                                 boolean include_subclasses)
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
Specified by:
queryKeyIterator in class AbstractWTCollection
Parameters:
filter -
include_subclasses -
Returns:
Iterator

queryKeyListIterator

public ListIterator queryKeyListIterator(int index)
Description copied from class: AbstractWTList


Supported API: false

Specified by:
queryKeyListIterator in interface WTList
Specified by:
queryKeyListIterator in class AbstractWTList
Parameters:
index -
Returns:
ListIterator

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
Specified by:
referenceIterator in class AbstractWTCollection
Returns:
Iterator

referenceIterator

public Iterator referenceIterator(Class filter,
                                  boolean include_subclasses)
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
Specified by:
referenceIterator in class AbstractWTCollection
Parameters:
filter -
include_subclasses -
Returns:
Iterator

referenceListIterator

public ListIterator referenceListIterator(int index)
Description copied from class: AbstractWTList


Supported API: false

Specified by:
referenceListIterator in interface WTList
Specified by:
referenceListIterator in class AbstractWTList
Parameters:
index -
Returns:
ListIterator

remove

public Object remove(int index)
Description copied from class: AbstractWTList


Supported API: false

Specified by:
remove in interface List
Overrides:
remove in class AbstractWTList
Parameters:
index -
Returns:
Object

set

public WTReference set(int index,
                       WTReference ref)
Description copied from class: AbstractWTList


Supported API: false

Specified by:
set in interface WTList
Overrides:
set in class AbstractWTList
Parameters:
index -
ref -
Returns:
WTReference

size

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

subCollection

public WTCollection subCollection(Class filter,
                                  boolean include_subclasses)
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
Specified by:
subCollection in class AbstractWTCollection
Parameters:
filter -
include_subclasses -
Returns:
WTCollection

subList

public List subList(int fromIndex,
                    int toIndex)
Description copied from class: AbstractWTList


Supported API: false

Specified by:
subList in interface WTList
Specified by:
subList in class AbstractWTList
Parameters:
fromIndex -
toIndex -
Returns:
List

getModCount

int getModCount()
Specified by:
getModCount in class AbstractWTList