|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cayenne.access.IncrementalFaultList<E>
public class IncrementalFaultList<E>
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 int |
idWidth
Stores a hint allowing to distinguish data rows from unfetched ids when the query fetches data rows. |
protected SelectQuery |
internalQuery
|
protected int |
maxFetchSize
Defines the upper limit on the size of fetches. |
protected int |
pageSize
|
protected ObjEntity |
rootEntity
|
protected int |
unfetchedObjects
|
| Constructor Summary | |
|---|---|
IncrementalFaultList(DataContext dataContext,
Query query)
Deprecated. since 3.1 use IncrementalFaultList(DataContext, Query, int). |
|
IncrementalFaultList(DataContext dataContext,
Query query,
int maxFetchSize)
Creates a new IncrementalFaultList using a given DataContext and query. |
|
| Method Summary | ||
|---|---|---|
void |
add(int index,
Object element)
|
|
boolean |
add(Object o)
|
|
boolean |
addAll(Collection<? extends E> c)
|
|
boolean |
addAll(int index,
Collection<? extends E> c)
|
|
void |
clear()
|
|
boolean |
contains(Object o)
|
|
boolean |
containsAll(Collection<?> c)
|
|
protected void |
fillIn(Query query,
List elementsList)
Performs initialization of the list of objects. |
|
E |
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<E> |
iterator()
Return an iterator for this list. |
|
int |
lastIndexOf(Object o)
|
|
ListIterator<E> |
listIterator()
Returns a list iterator for this list. |
|
ListIterator<E> |
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. |
|
E |
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)
|
|
E |
set(int index,
Object element)
|
|
void |
setMaxFetchSize(int fetchSize)
|
|
int |
size()
|
|
List<E> |
subList(int fromIndex,
int toIndex)
|
|
Object[] |
toArray()
|
|
|
toArray(T[] 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 idWidth
protected int maxFetchSize
| Constructor Detail |
|---|
@Deprecated
public IncrementalFaultList(DataContext dataContext,
Query query)
IncrementalFaultList(DataContext, Query, int).
public IncrementalFaultList(DataContext dataContext,
Query query,
int maxFetchSize)
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.maxFetchSize - maximum number of fetches in one query| Method Detail |
|---|
protected void fillIn(Query query,
List elementsList)
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<E> listIterator()
listIterator in interface List<E>public ListIterator<E> listIterator(int index)
listIterator in interface List<E>public Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in interface List<E>
public void add(int index,
Object element)
add in interface List<E>List.add(int, Object)public boolean add(Object o)
add in interface Collection<E>add in interface List<E>Collection.add(Object)public boolean addAll(Collection<? extends E> c)
addAll in interface Collection<E>addAll in interface List<E>Collection.addAll(Collection)
public boolean addAll(int index,
Collection<? extends E> c)
addAll in interface List<E>List.addAll(int, Collection)public void clear()
clear in interface Collection<E>clear in interface List<E>Collection.clear()public boolean contains(Object o)
contains in interface Collection<E>contains in interface List<E>Collection.contains(Object)public boolean containsAll(Collection<?> c)
containsAll in interface Collection<E>containsAll in interface List<E>Collection.containsAll(Collection)public E get(int index)
get in interface List<E>public int indexOf(Object o)
indexOf in interface List<E>List.indexOf(Object)public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface List<E>Collection.isEmpty()public int lastIndexOf(Object o)
lastIndexOf in interface List<E>public E remove(int index)
remove in interface List<E>public boolean remove(Object o)
remove in interface Collection<E>remove in interface List<E>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<E>removeAll in interface List<E>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<E>retainAll in interface List<E>
public E set(int index,
Object element)
set in interface List<E>List.set(int, Object)public int size()
size in interface Collection<E>size in interface List<E>Collection.size()
public List<E> subList(int fromIndex,
int toIndex)
subList in interface List<E>public Object[] toArray()
toArray in interface Collection<E>toArray in interface List<E>public <T> T[] toArray(T[] a)
toArray in interface Collection<E>toArray in interface List<E>public int getUnfetchedObjects()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||