org.datanucleus.store.scostore
Interface CollectionStore

All Superinterfaces:
Store
All Known Subinterfaces:
ListStore, SetStore
All Known Implementing Classes:
AbstractCollectionStore, AbstractListStore, AbstractSetStore, FKListStore, FKSetStore, JoinListStore, JoinSetStore, MapEntrySetStore, MapKeySetStore, MapValueSetStore

public interface CollectionStore
extends Store

Interface representation of the backing store for a Collection.


Method Summary
 boolean add(ObjectProvider sm, java.lang.Object element, int size)
          Method to add an element to the collection.
 boolean addAll(ObjectProvider sm, java.util.Collection elements, int size)
          Method to add a collection of elements to the collection.
 void clear(ObjectProvider sm)
          Method to clear the collection.
 boolean contains(ObjectProvider sm, java.lang.Object element)
          Method to check if an element exists in the collection.
 java.lang.String getElementType()
          Accessor for the element type in the collection.
 boolean hasOrderMapping()
          Accessor for whether the store utilises an order mapping.
 java.util.Iterator iterator(ObjectProvider sm)
          Accessor for an iterator for the collection.
 boolean remove(ObjectProvider sm, java.lang.Object element, int size, boolean allowDependentField)
          Method to remove an element from the collection.
 boolean removeAll(ObjectProvider sm, java.util.Collection elements, int size)
          Method to remove a collection of elements from the collection.
 int size(ObjectProvider sm)
          Accessor for the size of the collection.
 void update(ObjectProvider sm, java.util.Collection coll)
          Method to update the collection to be the supplied collection of elements.
 boolean updateEmbeddedElement(ObjectProvider sm, java.lang.Object element, int fieldNumber, java.lang.Object value)
          Method to update en embedded element in the collection.
 
Methods inherited from interface org.datanucleus.store.scostore.Store
getStoreManager
 

Method Detail

getElementType

java.lang.String getElementType()
Accessor for the element type in the collection.

Returns:
The element type.

hasOrderMapping

boolean hasOrderMapping()
Accessor for whether the store utilises an order mapping. An order mapping is used to allow for ordering of elements or to allow duplicates.

Returns:
Whether it uses an order mapping.

updateEmbeddedElement

boolean updateEmbeddedElement(ObjectProvider sm,
                              java.lang.Object element,
                              int fieldNumber,
                              java.lang.Object value)
Method to update en embedded element in the collection.

Parameters:
sm - State Manager of the owner
element - The element
fieldNumber - Field to update in the element
value - The new value for the field
Returns:
Whether the element was modified

iterator

java.util.Iterator iterator(ObjectProvider sm)
Accessor for an iterator for the collection.

Parameters:
sm - State Manager for the collection.
Returns:
Iterator for the collection.

size

int size(ObjectProvider sm)
Accessor for the size of the collection.

Parameters:
sm - State Manager for the collection.
Returns:
The size of the collection.

contains

boolean contains(ObjectProvider sm,
                 java.lang.Object element)
Method to check if an element exists in the collection.

Parameters:
sm - State Manager for the collection.
element - Element to check
Returns:
Whether the element exists in the collection.

add

boolean add(ObjectProvider sm,
            java.lang.Object element,
            int size)
Method to add an element to the collection.

Parameters:
sm - State Manager for the collection.
element - Element to add
size - Current size of the collection if known. -1 if not known
Returns:
Whether the element was added ok

addAll

boolean addAll(ObjectProvider sm,
               java.util.Collection elements,
               int size)
Method to add a collection of elements to the collection.

Parameters:
sm - State Manager for the collection.
elements - Elements to add
size - Current size of collection (if known). -1 if not known
Returns:
Whether the elements were added ok

remove

boolean remove(ObjectProvider sm,
               java.lang.Object element,
               int size,
               boolean allowDependentField)
Method to remove an element from the collection.

Parameters:
sm - State Manager for the collection.
element - Element to remove
size - Current size of collection if known. -1 if not known
allowDependentField - Whether to allow any cascading delete actions to be fired from this removal
Returns:
Whether the element was removed ok

removeAll

boolean removeAll(ObjectProvider sm,
                  java.util.Collection elements,
                  int size)
Method to remove a collection of elements from the collection.

Parameters:
sm - State Manager for the collection.
elements - Element to remove
size - Current size of collection if known. -1 if not known
Returns:
Whether the elements were removed ok

clear

void clear(ObjectProvider sm)
Method to clear the collection.

Parameters:
sm - State Manager for the collection.

update

void update(ObjectProvider sm,
            java.util.Collection coll)
Method to update the collection to be the supplied collection of elements.

Parameters:
sm - StateManager of the object
coll - The collection to use


Copyright © 2011. All Rights Reserved.