|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cayenne.access.IncrementalFaultList
public class IncrementalFaultList
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.
The list can hold DataRows or 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 List |
elements
|
protected SelectQuery |
internalQuery
|
protected int |
maxFetchSize
Defines the upper limit on the size of fetches. |
protected int |
pageSize
|
protected ObjEntity |
rootEntity
|
protected int |
rowWidth
Stores a hint allowing to distinguish data rows from unfetched ids when the query fetches data rows. |
protected int |
unfetchedObjects
|
| Constructor Summary | |
|---|---|
IncrementalFaultList(DataContext dataContext,
Query query)
Creates a new IncrementalFaultList using a given DataContext and query. |
|
IncrementalFaultList(IncrementalFaultList list)
Creates a new list copying settings from another list. |
|
| Method Summary | |
|---|---|
void |
add(int index,
Object element)
|
boolean |
add(Object o)
|
boolean |
addAll(Collection c)
|
boolean |
addAll(int index,
Collection c)
|
void |
clear()
|
boolean |
contains(Object o)
|
boolean |
containsAll(Collection c)
|
protected void |
fillIn(Query query)
Deprecated. since 3.0 this method is not called and is deprecated in favor of fillIn(Query, List, boolean), as this method performed unneeded
synchronization. |
protected void |
fillIn(Query query,
List elementsList,
boolean resolvesFirstPage)
Performs initialization of the list of objects. |
Object |
get(int index)
|
DataContext |
getDataContext()
Returns the dataContext. |
int |
getMaxFetchSize()
Get the upper bound on the number of records to resolve in one round trip to the database. |
int |
getPageSize()
Returns the pageSize. |
int |
getUnfetchedObjects()
Returns a total number of objects that are not resolved yet. |
int |
indexOf(Object o)
|
boolean |
isEmpty()
|
Iterator |
iterator()
Return an iterator for this list. |
int |
lastIndexOf(Object o)
|
ListIterator |
listIterator()
Returns a list iterator for this list. |
ListIterator |
listIterator(int index)
Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list. |
int |
pageIndex(int elementIndex)
Returns zero-based index of the virtual "page" for a given array element index. |
Object |
remove(int index)
|
boolean |
remove(Object o)
|
boolean |
removeAll(Collection c)
|
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(Collection c)
|
Object |
set(int index,
Object element)
|
void |
setMaxFetchSize(int fetchSize)
|
int |
size()
|
List |
subList(int fromIndex,
int toIndex)
|
Object[] |
toArray()
|
Object[] |
toArray(Object[] a)
|
| 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 |
|---|
protected int pageSize
protected List elements
protected DataContext dataContext
protected ObjEntity rootEntity
protected SelectQuery internalQuery
protected int unfetchedObjects
protected int rowWidth
protected int maxFetchSize
| Constructor Detail |
|---|
public IncrementalFaultList(IncrementalFaultList list)
public IncrementalFaultList(DataContext dataContext,
Query query)
dataContext - DataContext used by IncrementalFaultList to fill itself with
objects.query - Main query used to retrieve data. Must have "pageSize" property set to
a value greater than zero.| Method Detail |
|---|
protected void fillIn(Query query)
fillIn(Query, List, boolean), as this method performed unneeded
synchronization.
protected void fillIn(Query query,
List elementsList,
boolean resolvesFirstPage)
public void resolveAll()
protected void resolveInterval(int fromIndex,
int toIndex)
fromIndex up to but not
including toIndex. Internally performs bound checking and trims
indexes accordingly.
public int pageIndex(int elementIndex)
public int getMaxFetchSize()
public void setMaxFetchSize(int fetchSize)
public DataContext getDataContext()
public int getPageSize()
public ListIterator listIterator()
listIterator in interface Listpublic ListIterator listIterator(int index)
listIterator in interface Listpublic Iterator iterator()
iterator in interface Iterableiterator in interface Collectioniterator in interface List
public void add(int index,
Object element)
add in interface ListList.add(int, Object)public boolean add(Object o)
add in interface Collectionadd in interface ListCollection.add(Object)public boolean addAll(Collection c)
addAll in interface CollectionaddAll in interface ListCollection.addAll(Collection)
public boolean addAll(int index,
Collection c)
addAll in interface ListList.addAll(int, Collection)public void clear()
clear in interface Collectionclear in interface ListCollection.clear()public boolean contains(Object o)
contains in interface Collectioncontains in interface ListCollection.contains(Object)public boolean containsAll(Collection c)
containsAll in interface CollectioncontainsAll in interface ListCollection.containsAll(Collection)public Object get(int index)
get in interface ListList.get(int)public int indexOf(Object o)
indexOf in interface ListList.indexOf(Object)public boolean isEmpty()
isEmpty in interface CollectionisEmpty in interface ListCollection.isEmpty()public int lastIndexOf(Object o)
lastIndexOf in interface ListList.lastIndexOf(Object)public Object remove(int index)
remove in interface ListList.remove(int)public boolean remove(Object o)
remove in interface Collectionremove in interface ListCollection.remove(Object)public boolean removeAll(Collection c)
removeAll in interface CollectionremoveAll in interface ListCollection.removeAll(Collection)public boolean retainAll(Collection c)
retainAll in interface CollectionretainAll in interface ListCollection.retainAll(Collection)
public Object set(int index,
Object element)
set in interface ListList.set(int, Object)public int size()
size in interface Collectionsize in interface ListCollection.size()
public List subList(int fromIndex,
int toIndex)
subList in interface Listpublic Object[] toArray()
toArray in interface CollectiontoArray in interface Listpublic Object[] toArray(Object[] a)
toArray in interface CollectiontoArray in interface ListCollection.toArray(Object[])public int getUnfetchedObjects()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||