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

## org.apache.cayenne.util
Class PersistentObjectList

    java.lang.Object
      org.apache.cayenne.util.RelationshipFault
          org.apache.cayenne.util.PersistentObjectList

All Implemented Interfaces:
  Serializable, Iterable, Collection, List, ValueHolder

Direct Known Subclasses:
  ToManyList

    public class PersistentObjectList

extends RelationshipFault
implements List, ValueHolder

A list of persistent objects lazily resolved on the first access.

Since:
  1.2
See Also:
  Serialized Form

Field Summary
`protected LinkedList` | `addedToUnresolved`
`protected List` | `objectList`
`protected LinkedList<Object>` | `removedFromUnresolved`

Fields inherited from class org.apache.cayenne.util.RelationshipFault
`relationshipName, relationshipOwner`

Constructor Summary
`PersistentObjectList(Persistent relationshipOwner, String relationshipName)` Creates PersistentObjectList initializing it with list owner persistent object and relationship name that this list maps to.

Method Summary
`void` | `add(int index, Object o)`
`boolean` | `add(Object o)`
`boolean` | `addAll(Collection c)`
`boolean` | `addAll(int index, Collection c)`
`protected boolean` | `addLocal(Object object)`
`void` | `clear()`
`protected void` | `clearLocalChanges()`
`boolean` | `contains(Object o)`
`boolean` | `containsAll(Collection c)`
`boolean` | `equals(Object o)`
`Object` | `get(int index)`
`Object` | `getValue()` Returns an object stored by this ValueHolder.
`Object` | `getValueDirectly()` Retrieves ValueHolder value without triggering fault resolution.
`int` | `hashCode()`
`int` | `indexOf(Object o)`
`void` | `invalidate()` Turns itself into a fault, thus forcing a refresh on the next access.
`boolean` | `isEmpty()`
`boolean` | `isFault()` Returns whether this list is not yet resolved and requires a fetch.
`Iterator` | `iterator()`
`int` | `lastIndexOf(Object o)`
`ListIterator` | `listIterator()`
`ListIterator` | `listIterator(int index)`
`protected void` | `mergeLocalChanges(List fetchedList)`
`protected void` | `postprocessAdd(Collection collection)`
`protected void` | `postprocessAdd(Object addedObject)`
`protected void` | `postprocessRemove(Collection collection)`
`protected void` | `postprocessRemove(Object removedObject)`
`Object` | `remove(int index)`
`boolean` | `remove(Object o)`
`boolean` | `removeAll(Collection c)`
`protected boolean` | `removeLocal(Object object)`
`protected List` | `resolvedObjectList()` Returns internal objects list resolving it if needed.
`boolean` | `retainAll(Collection c)`
`Object` | `set(int index, Object o)`
`void` | `setObjectList(List objectList)`
`Object` | `setValue(Object value)` Sets an object stored by this ValueHolder.
`Object` | `setValueDirectly(Object value)` Sets ValueHolder vaue without triggering fault resolution.
`protected boolean` | `shouldAddToRemovedFromUnresolvedList(Object object)`
`int` | `size()`
`List` | `subList(int fromIndex, int toIndex)`
`Object[]` | `toArray()`
`Object[]` | `toArray(Object[] a)`
`String` | `toString()`

Methods inherited from class org.apache.cayenne.util.RelationshipFault
`getRelationshipName, getRelationshipOwner, isTransientParent, isUncommittedParent, resolveFromDB, updateReverse`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### objectList

    protected List objectList

### addedToUnresolved

    protected LinkedList addedToUnresolved

### removedFromUnresolved

    protected LinkedList<Object> removedFromUnresolved

Constructor Detail

### PersistentObjectList

    public PersistentObjectList(Persistent relationshipOwner,
                                String relationshipName)

  Creates PersistentObjectList initializing it with list owner persistent object and relationship name that this list maps to.

  Parameters:
    `relationshipOwner` - persistent object that owns this list.
    `relationshipName` - a query used to resolve the list

Method Detail

### isFault

    public boolean isFault()

  Returns whether this list is not yet resolved and requires a fetch.

  Specified by:
    `isFault` in interface `ValueHolder`

### invalidate

    public void invalidate()

  Turns itself into a fault, thus forcing a refresh on the next access.

  Specified by:
    `invalidate` in interface `ValueHolder`

### setValueDirectly

    public Object setValueDirectly(Object value)
                            throws CayenneRuntimeException

  Description copied from interface: `ValueHolder`
  Sets ValueHolder vaue without triggering fault resolution.

  Specified by:
    `setValueDirectly` in interface `ValueHolder`
  Throws:
    `CayenneRuntimeException`

### getValue

    public Object getValue()
                    throws CayenneRuntimeException

  Description copied from interface: `ValueHolder`
  Returns an object stored by this ValueHolder.

  Specified by:
    `getValue` in interface `ValueHolder`
  Throws:
    `CayenneRuntimeException`

### getValueDirectly

    public Object getValueDirectly()
                            throws CayenneRuntimeException

  Description copied from interface: `ValueHolder`
  Retrieves ValueHolder value without triggering fault resolution.

  Specified by:
    `getValueDirectly` in interface `ValueHolder`
  Throws:
    `CayenneRuntimeException`

### setValue

    public Object setValue(Object value)
                    throws CayenneRuntimeException

  Description copied from interface: `ValueHolder`
  Sets an object stored by this ValueHolder.

  Specified by:
    `setValue` in interface `ValueHolder`
  Parameters:
    `value` - a new value of the ValueHolder.
  Returns:
    a previous value saved in the ValueHolder.
  Throws:
    `CayenneRuntimeException`

### setObjectList

    public void setObjectList(List objectList)

### add

    public boolean add(Object o)

  Specified by:
    `add` in interface `Collection`
  Specified by:
    `add` in interface `List`

### add

    public void add(int index,
                    Object o)

  Specified by:
    `add` in interface `List`

### addAll

    public boolean addAll(Collection c)

  Specified by:
    `addAll` in interface `Collection`
  Specified by:
    `addAll` in interface `List`

### addAll

    public boolean addAll(int index,
                          Collection c)

  Specified by:
    `addAll` in interface `List`

### clear

    public void clear()

  Specified by:
    `clear` in interface `Collection`
  Specified by:
    `clear` in interface `List`

### contains

    public boolean contains(Object o)

  Specified by:
    `contains` in interface `Collection`
  Specified by:
    `contains` in interface `List`

### containsAll

    public boolean containsAll(Collection c)

  Specified by:
    `containsAll` in interface `Collection`
  Specified by:
    `containsAll` in interface `List`

### equals

    public boolean equals(Object o)

  Specified by:
    `equals` in interface `Collection`
  Specified by:
    `equals` in interface `List`
  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Specified by:
    `hashCode` in interface `Collection`
  Specified by:
    `hashCode` in interface `List`
  Overrides:
    `hashCode` in class `Object`

### get

    public Object get(int index)

  Specified by:
    `get` in interface `List`

### indexOf

    public int indexOf(Object o)

  Specified by:
    `indexOf` in interface `List`

### isEmpty

    public boolean isEmpty()

  Specified by:
    `isEmpty` in interface `Collection`
  Specified by:
    `isEmpty` in interface `List`

### iterator

    public Iterator iterator()

  Specified by:
    `iterator` in interface `Iterable`
  Specified by:
    `iterator` in interface `Collection`
  Specified by:
    `iterator` in interface `List`

### lastIndexOf

    public int lastIndexOf(Object o)

  Specified by:
    `lastIndexOf` in interface `List`

### listIterator

    public ListIterator listIterator()

  Specified by:
    `listIterator` in interface `List`

### listIterator

    public ListIterator listIterator(int index)

  Specified by:
    `listIterator` in interface `List`

### remove

    public Object remove(int index)

  Specified by:
    `remove` in interface `List`

### remove

    public boolean remove(Object o)

  Specified by:
    `remove` in interface `Collection`
  Specified by:
    `remove` in interface `List`

### removeAll

    public boolean removeAll(Collection c)

  Specified by:
    `removeAll` in interface `Collection`
  Specified by:
    `removeAll` in interface `List`

### retainAll

    public boolean retainAll(Collection c)

  Specified by:
    `retainAll` in interface `Collection`
  Specified by:
    `retainAll` in interface `List`

### set

    public Object set(int index,
                      Object o)

  Specified by:
    `set` in interface `List`

### size

    public int size()

  Specified by:
    `size` in interface `Collection`
  Specified by:
    `size` in interface `List`

### subList

    public List subList(int fromIndex,
                        int toIndex)

  Specified by:
    `subList` in interface `List`

### toArray

    public Object[] toArray()

  Specified by:
    `toArray` in interface `Collection`
  Specified by:
    `toArray` in interface `List`

### toArray

    public Object[] toArray(Object[] a)

  Specified by:
    `toArray` in interface `Collection`
  Specified by:
    `toArray` in interface `List`

### resolvedObjectList

    protected List resolvedObjectList()

  Returns internal objects list resolving it if needed.

### clearLocalChanges

    protected void clearLocalChanges()

### mergeLocalChanges

    protected void mergeLocalChanges(List fetchedList)

### addLocal

    protected boolean addLocal(Object object)

### removeLocal

    protected boolean removeLocal(Object object)

### shouldAddToRemovedFromUnresolvedList

    protected boolean shouldAddToRemovedFromUnresolvedList(Object object)

  Returns:
    whether object should be added to `removedFromUnresolved` during removal

### postprocessAdd

    protected void postprocessAdd(Collection collection)

### postprocessRemove

    protected void postprocessRemove(Collection collection)

### postprocessAdd

    protected void postprocessAdd(Object addedObject)

### postprocessRemove

    protected void postprocessRemove(Object removedObject)

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

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

Copyright © 2001-2009 Apache Cayenne. All Rights Reserved.