Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.remote
Class RemoteIncrementalFaultList

    java.lang.Object
      org.apache.cayenne.remote.RemoteIncrementalFaultList

All Implemented Interfaces:
  java.lang.Iterable, java.util.Collection, java.util.List

    public class RemoteIncrementalFaultList

extends java.lang.Object
implements java.util.List

A list that serves as a container of Persistent objects. It is usually returned by an ObjectContext when a paginated query is performed. Initially only the first "page" of objects is fully resolved. Pages following the first page are resolved on demand. When a list element is accessed, 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 Persistent objects. Attempts to add any other object types will result in an exception.

Certain operations like `toArray` would trigger full list fetch.

Synchronization Note: this list is not synchronized. All access to it should follow synchronization rules applicable for ArrayList.

Since:
  1.2
Author:
  Andrus Adamchik

Field Summary
`protected java.lang.String` | `cacheKey`
`protected ObjectContext` | `context`
`protected java.util.List` | `elements`
`protected QueryMetadata` | `metadata`
`protected int` | `pageSize`
`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
`RemoteIncrementalFaultList(ObjectContext context, Query paginatedQuery)`

Method Summary
`void` | `add(int index, java.lang.Object element)`
`boolean` | `add(java.lang.Object o)`
`boolean` | `addAll(java.util.Collection c)`
`boolean` | `addAll(int index, java.util.Collection c)`
`void` | `clear()`
`boolean` | `contains(java.lang.Object o)`
`boolean` | `containsAll(java.util.Collection c)`
`java.lang.Object` | `get(int index)`
`ObjectContext` | `getContext()` Returns ObjectContext associated with this list.
`int` | `getPageSize()` Returns the pageSize.
`int` | `getUnfetchedObjects()` Returns a total number of objects that are not resolved yet.
`int` | `indexOf(java.lang.Object o)`
`boolean` | `isEmpty()`
`java.util.Iterator` | `iterator()` Return an iterator for this list.
`int` | `lastIndexOf(java.lang.Object o)`
`java.util.ListIterator` | `listIterator()` Returns a list iterator for this list.
`java.util.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.
`java.lang.Object` | `remove(int index)`
`boolean` | `remove(java.lang.Object o)`
`boolean` | `removeAll(java.util.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(java.util.Collection c)`
`java.lang.Object` | `set(int index, java.lang.Object element)`
`int` | `size()`
`java.util.List` | `subList(int fromIndex, int toIndex)`
`java.lang.Object[]` | `toArray()`
`java.lang.Object[]` | `toArray(java.lang.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

### elements

    protected java.util.List elements

### cacheKey

    protected java.lang.String cacheKey

### pageSize

    protected int pageSize

### unfetchedObjects

    protected int unfetchedObjects

### metadata

    protected QueryMetadata metadata

### context

    protected transient ObjectContext context

### rowWidth

    protected int rowWidth

  Stores a hint allowing to distinguish data rows from unfetched ids when the query fetches data rows.

Constructor Detail

### RemoteIncrementalFaultList

    public RemoteIncrementalFaultList(ObjectContext context,
                                      Query paginatedQuery)

Method Detail

### resolveAll

    public void resolveAll()

  Will resolve all unread objects.

### resolveInterval

    protected void resolveInterval(int fromIndex,
                                   int toIndex)

  Resolves a sublist of objects starting at `fromIndex` up to but not including `toIndex`. Internally performs bound checking and trims indexes accordingly.

### getContext

    public ObjectContext getContext()

  Returns ObjectContext associated with this list.

### getPageSize

    public int getPageSize()

  Returns the pageSize.

  Returns:
    int

### listIterator

    public java.util.ListIterator listIterator()

  Returns a list iterator for this list. DataObjects are resolved a page (according to getPageSize()) at a time as necessary - when retrieved with next() or previous().

  Specified by:
    `listIterator` in interface `java.util.List`

### listIterator

    public java.util.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. The specified index indicates the first element that would be returned by an initial call to the next method. An initial call to the previous method would return the element with the specified index minus one. DataObjects are resolved a page at a time (according to getPageSize()) as necessary - when retrieved with next() or previous().

  Specified by:
    `listIterator` in interface `java.util.List`

### iterator

    public java.util.Iterator iterator()

  Return an iterator for this list. DataObjects are resolved a page (according to getPageSize()) at a time as necessary - when retrieved with next().

  Specified by:
    `iterator` in interface `java.lang.Iterable`
  Specified by:
    `iterator` in interface `java.util.Collection`
  Specified by:
    `iterator` in interface `java.util.List`

### add

    public void add(int index,
                    java.lang.Object element)

  Specified by:
    `add` in interface `java.util.List`
  See Also:
    `List.add(int, Object)`

### add

    public boolean add(java.lang.Object o)

  Specified by:
    `add` in interface `java.util.Collection`
  Specified by:
    `add` in interface `java.util.List`
  See Also:
    `Collection.add(Object)`

### addAll

    public boolean addAll(java.util.Collection c)

  Specified by:
    `addAll` in interface `java.util.Collection`
  Specified by:
    `addAll` in interface `java.util.List`
  See Also:
    `Collection.addAll(Collection)`

### addAll

    public boolean addAll(int index,
                          java.util.Collection c)

  Specified by:
    `addAll` in interface `java.util.List`
  See Also:
    `List.addAll(int, Collection)`

### clear

    public void clear()

  Specified by:
    `clear` in interface `java.util.Collection`
  Specified by:
    `clear` in interface `java.util.List`
  See Also:
    `Collection.clear()`

### contains

    public boolean contains(java.lang.Object o)

  Specified by:
    `contains` in interface `java.util.Collection`
  Specified by:
    `contains` in interface `java.util.List`
  See Also:
    `Collection.contains(Object)`

### containsAll

    public boolean containsAll(java.util.Collection c)

  Specified by:
    `containsAll` in interface `java.util.Collection`
  Specified by:
    `containsAll` in interface `java.util.List`
  See Also:
    `Collection.containsAll(Collection)`

### get

    public java.lang.Object get(int index)

  Specified by:
    `get` in interface `java.util.List`
  See Also:
    `List.get(int)`

### indexOf

    public int indexOf(java.lang.Object o)

  Specified by:
    `indexOf` in interface `java.util.List`
  See Also:
    `List.indexOf(Object)`

### isEmpty

    public boolean isEmpty()

  Specified by:
    `isEmpty` in interface `java.util.Collection`
  Specified by:
    `isEmpty` in interface `java.util.List`
  See Also:
    `Collection.isEmpty()`

### lastIndexOf

    public int lastIndexOf(java.lang.Object o)

  Specified by:
    `lastIndexOf` in interface `java.util.List`
  See Also:
    `List.lastIndexOf(Object)`

### remove

    public java.lang.Object remove(int index)

  Specified by:
    `remove` in interface `java.util.List`
  See Also:
    `List.remove(int)`

### remove

    public boolean remove(java.lang.Object o)

  Specified by:
    `remove` in interface `java.util.Collection`
  Specified by:
    `remove` in interface `java.util.List`
  See Also:
    `Collection.remove(Object)`

### removeAll

    public boolean removeAll(java.util.Collection c)

  Specified by:
    `removeAll` in interface `java.util.Collection`
  Specified by:
    `removeAll` in interface `java.util.List`
  See Also:
    `Collection.removeAll(Collection)`

### retainAll

    public boolean retainAll(java.util.Collection c)

  Specified by:
    `retainAll` in interface `java.util.Collection`
  Specified by:
    `retainAll` in interface `java.util.List`
  See Also:
    `Collection.retainAll(Collection)`

### set

    public java.lang.Object set(int index,
                                java.lang.Object element)

  Specified by:
    `set` in interface `java.util.List`
  See Also:
    `List.set(int, Object)`

### size

    public int size()

  Specified by:
    `size` in interface `java.util.Collection`
  Specified by:
    `size` in interface `java.util.List`
  See Also:
    `Collection.size()`

### subList

    public java.util.List subList(int fromIndex,
                                  int toIndex)

  Specified by:
    `subList` in interface `java.util.List`

### toArray

    public java.lang.Object[] toArray()

  Specified by:
    `toArray` in interface `java.util.Collection`
  Specified by:
    `toArray` in interface `java.util.List`

### toArray

    public java.lang.Object[] toArray(java.lang.Object[] a)

  Specified by:
    `toArray` in interface `java.util.Collection`
  Specified by:
    `toArray` in interface `java.util.List`
  See Also:
    `Collection.toArray(Object[])`

### getUnfetchedObjects

    public int getUnfetchedObjects()

  Returns a total number of objects that are not resolved yet.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2006 Apache.org All Rights Reserved.