|
|||||||||
| Home >> All >> org >> objectstyle >> cayenne >> [ access overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.objectstyle.cayenne.access
Class IncrementalFaultList

java.lang.Objectorg.objectstyle.cayenne.access.IncrementalFaultList
- All Implemented Interfaces:
- java.util.Collection, java.lang.Iterable, java.util.List
- public class IncrementalFaultList
- extends java.lang.Object
- implements java.util.List
- extends java.lang.Object
A synchronized list that serves as a container of DataObjects. It is returned when a paged query is performed by DataContext. On creation, only the first "page" is fully resolved, for the rest of the objects only their ObjectIds are read. Pages following the first page are resolved on demand only. On access to an element, the list would ensure that this element as well as all its siblings on the same page are fully resolved.
Note that this list would only allow addition of DataObjects. Attempts to add any other object types will result in an exception.
Performance note: certain operations like toArray would
trigger full list fetch.
| Field Summary | |
protected DataContext |
dataContext
|
protected java.util.List |
elements
|
protected org.objectstyle.cayenne.query.SelectQuery |
internalQuery
|
protected int |
pageSize
|
protected org.objectstyle.cayenne.map.ObjEntity |
rootEntity
|
protected int |
unfetchedObjects
|
| Constructor Summary | |
IncrementalFaultList(DataContext dataContext,
org.objectstyle.cayenne.query.GenericSelectQuery query)
|
|
IncrementalFaultList(IncrementalFaultList list)
Creates a new list copying settings from another list. |
|
| Method Summary | |
void |
add(int index,
java.lang.Object element)
Insert an element into the list at a given position (optional operation). |
boolean |
add(java.lang.Object o)
Add an element to the end of the list (optional operation). |
boolean |
addAll(java.util.Collection c)
Add the contents of a collection to the end of the list (optional operation). |
boolean |
addAll(int index,
java.util.Collection c)
Insert the contents of a collection into the list at a given position (optional operation). |
void |
clear()
Clear the list, such that a subsequent call to isEmpty() would return true (optional operation). |
boolean |
contains(java.lang.Object o)
Test whether this list contains a given object as one of its elements. |
boolean |
containsAll(java.util.Collection c)
Test whether this list contains every element in a given collection. |
protected void |
fillIn(org.objectstyle.cayenne.query.GenericSelectQuery query)
Performs initialization of the internal list of objects. |
java.lang.Object |
get(int index)
Get the element at a given index in this list. |
DataContext |
getDataContext()
Returns the dataContext. |
int |
getPageSize()
Returns the pageSize. |
int |
getUnfetchedObjects()
Returns a total number of objects that are not resolved yet. |
int |
indexOf(java.lang.Object o)
Obtain the first index at which a given object is to be found in this list. |
boolean |
isEmpty()
Test whether this list is empty, that is, if size() == 0. |
java.util.Iterator |
iterator()
This method would resolve all unresolved objects and then return an iterator over an internal list. |
int |
lastIndexOf(java.lang.Object o)
Obtain the last index at which a given object is to be found in this list. |
java.util.ListIterator |
listIterator()
This method would resolve all unresolved objects and then return a list iterator over an internal list. |
java.util.ListIterator |
listIterator(int index)
This method would resolve all unresolved objects and then return a list iterator over an internal list. |
int |
pageIndex(int elementIndex)
|
java.lang.Object |
remove(int index)
Remove the element at a given position in this list (optional operation). |
boolean |
remove(java.lang.Object o)
Remove the first occurence of an object from this list (optional operation). |
boolean |
removeAll(java.util.Collection c)
Remove all elements of a given collection from this list (optional operation). |
void |
resolveAll()
Will resolve all unread objects. |
protected void |
resolveInterval(int fromIndex,
int toIndex)
Resolves a sublist of objects starting at fromIndex
up to but not including toIndex. |
boolean |
retainAll(java.util.Collection c)
Remove all elements of this list that are not contained in a given collection (optional operation). |
java.lang.Object |
set(int index,
java.lang.Object element)
Replace an element of this list with another object (optional operation). |
int |
size()
Get the number of elements in this list. |
java.util.List |
subList(int fromIndex,
int toIndex)
Obtain a List view of a subsection of this list, from fromIndex (inclusive) to toIndex (exclusive). |
java.lang.Object[] |
toArray()
Copy the current contents of this list into an array. |
java.lang.Object[] |
toArray(java.lang.Object[] a)
Copy the current contents of this list into an array. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.List |
equals, hashCode |
| Field Detail |
pageSize
protected int pageSize
elements
protected java.util.List elements
dataContext
protected DataContext dataContext
rootEntity
protected org.objectstyle.cayenne.map.ObjEntity rootEntity
internalQuery
protected org.objectstyle.cayenne.query.SelectQuery internalQuery
unfetchedObjects
protected int unfetchedObjects
| Constructor Detail |
IncrementalFaultList
public IncrementalFaultList(IncrementalFaultList list)
- Creates a new list copying settings from another list.
Elements WILL NOT be copied or fetched.
IncrementalFaultList
public IncrementalFaultList(DataContext dataContext, org.objectstyle.cayenne.query.GenericSelectQuery query)
| Method Detail |
fillIn
protected void fillIn(org.objectstyle.cayenne.query.GenericSelectQuery query)
- Performs initialization of the internal list of objects.
Only the first page is fully resolved. For the rest of
the list, only ObjectIds are read.
resolveAll
public void resolveAll()
- Will resolve all unread objects.
resolveInterval
protected void resolveInterval(int fromIndex,
int toIndex)
- Resolves a sublist of objects starting at
fromIndexup to but not includingtoIndex. Internally performs bound checking and trims indexes accordingly.
pageIndex
public int pageIndex(int elementIndex)
getDataContext
public DataContext getDataContext()
- Returns the dataContext.
getPageSize
public int getPageSize()
- Returns the pageSize.
listIterator
public java.util.ListIterator listIterator()
- This method would resolve all unresolved objects and then return
a list iterator over an internal list.
- Specified by:
listIteratorin interfacejava.util.List
listIterator
public java.util.ListIterator listIterator(int index)
- This method would resolve all unresolved objects and then return
a list iterator over an internal list.
- Specified by:
listIteratorin interfacejava.util.List
iterator
public java.util.Iterator iterator()
- This method would resolve all unresolved objects and then return
an iterator over an internal list.
- Specified by:
iteratorin interfacejava.util.List
add
public void add(int index,
java.lang.Object element)
- Description copied from interface:
java.util.List - Insert an element into the list at a given position (optional operation).
This shifts all existing elements from that position to the end one
index to the right. This version of add has no return, since it is
assumed to always succeed if there is no exception.
- Specified by:
addin interfacejava.util.List
add
public boolean add(java.lang.Object o)
- Description copied from interface:
java.util.List - Add an element to the end of the list (optional operation). If the list
imposes restraints on what can be inserted, such as no null elements,
this should be documented.
- Specified by:
addin interfacejava.util.List
addAll
public boolean addAll(java.util.Collection c)
- Description copied from interface:
java.util.List - Add the contents of a collection to the end of the list (optional
operation). This operation is undefined if this list is modified
during the operation (for example, if you try to insert a list into
itself).
- Specified by:
addAllin interfacejava.util.List
addAll
public boolean addAll(int index,
java.util.Collection c)
- Description copied from interface:
java.util.List - Insert the contents of a collection into the list at a given position
(optional operation). Shift all elements at that position to the right
by the number of elements inserted. This operation is undefined if
this list is modified during the operation (for example, if you try
to insert a list into itself).
- Specified by:
addAllin interfacejava.util.List
clear
public void clear()
- Description copied from interface:
java.util.List - Clear the list, such that a subsequent call to isEmpty() would return
true (optional operation).
- Specified by:
clearin interfacejava.util.List
contains
public boolean contains(java.lang.Object o)
- Description copied from interface:
java.util.List - Test whether this list contains a given object as one of its elements.
This is defined as the existence of an element e such that
o == null ? e == null : o.equals(e).- Specified by:
containsin interfacejava.util.List
containsAll
public boolean containsAll(java.util.Collection c)
- Description copied from interface:
java.util.List - Test whether this list contains every element in a given collection.
- Specified by:
containsAllin interfacejava.util.List
get
public java.lang.Object get(int index)
- Description copied from interface:
java.util.List - Get the element at a given index in this list.
- Specified by:
getin interfacejava.util.List
indexOf
public int indexOf(java.lang.Object o)
- Description copied from interface:
java.util.List - Obtain the first index at which a given object is to be found in this
list.
- Specified by:
indexOfin interfacejava.util.List
isEmpty
public boolean isEmpty()
- Description copied from interface:
java.util.List - Test whether this list is empty, that is, if size() == 0.
- Specified by:
isEmptyin interfacejava.util.List
lastIndexOf
public int lastIndexOf(java.lang.Object o)
- Description copied from interface:
java.util.List - Obtain the last index at which a given object is to be found in this
list.
- Specified by:
lastIndexOfin interfacejava.util.List
remove
public java.lang.Object remove(int index)
- Description copied from interface:
java.util.List - Remove the element at a given position in this list (optional operation).
Shifts all remaining elements to the left to fill the gap.
- Specified by:
removein interfacejava.util.List
remove
public boolean remove(java.lang.Object o)
- Description copied from interface:
java.util.List - Remove the first occurence of an object from this list (optional
operation). That is, remove the first element e such that
o == null ? e == null : o.equals(e).- Specified by:
removein interfacejava.util.List
removeAll
public boolean removeAll(java.util.Collection c)
- Description copied from interface:
java.util.List - Remove all elements of a given collection from this list (optional
operation). That is, remove every element e such that c.contains(e).
- Specified by:
removeAllin interfacejava.util.List
retainAll
public boolean retainAll(java.util.Collection c)
- Description copied from interface:
java.util.List - Remove all elements of this list that are not contained in a given
collection (optional operation). That is, remove every element e such
that !c.contains(e).
- Specified by:
retainAllin interfacejava.util.List
set
public java.lang.Object set(int index, java.lang.Object element)
- Description copied from interface:
java.util.List - Replace an element of this list with another object (optional operation).
- Specified by:
setin interfacejava.util.List
size
public int size()
- Description copied from interface:
java.util.List - Get the number of elements in this list. If the list contains more
than Integer.MAX_VALUE elements, return Integer.MAX_VALUE.
- Specified by:
sizein interfacejava.util.List
subList
public java.util.List subList(int fromIndex, int toIndex)
- Description copied from interface:
java.util.List - Obtain a List view of a subsection of this list, from fromIndex
(inclusive) to toIndex (exclusive). If the two indices are equal, the
sublist is empty. The returned list should be modifiable if and only
if this list is modifiable. Changes to the returned list should be
reflected in this list. If this list is structurally modified in
any way other than through the returned list, the result of any subsequent
operations on the returned list is undefined.
- Specified by:
subListin interfacejava.util.List
toArray
public java.lang.Object[] toArray()
- Description copied from interface:
java.util.List - Copy the current contents of this list into an array.
- Specified by:
toArrayin interfacejava.util.List
toArray
public java.lang.Object[] toArray(java.lang.Object[] a)
- Description copied from interface:
java.util.List - Copy the current contents of this list into an array. If the array passed
as an argument has length less than that of this list, an array of the
same run-time type as a, and length equal to the length of this list, is
allocated using Reflection. Otherwise, a itself is used. The elements of
this list are copied into it, and if there is space in the array, the
following element is set to null. The resultant array is returned.
Note: The fact that the following element is set to null is only useful
if it is known that this list does not contain any null elements.
- Specified by:
toArrayin interfacejava.util.List
getUnfetchedObjects
public int getUnfetchedObjects()
- Returns a total number of objects that are not resolved yet.
|
|||||||||
| Home >> All >> org >> objectstyle >> cayenne >> [ access overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.objectstyle.cayenne.access.IncrementalFaultList