Interface CollectionStore<E>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
add(DNStateManager sm, E element, int size)
Method to add an element to the collection.boolean
addAll(DNStateManager sm, Collection<E> elements, int size)
Method to add a collection of elements to the collection.void
clear(DNStateManager sm)
Method to clear the collection.boolean
contains(DNStateManager sm, Object element)
Method to check if an element exists in the collection.boolean
hasOrderMapping()
Accessor for whether the store utilises an order mapping.Iterator<E>
iterator(DNStateManager sm)
Accessor for an iterator for the collection.boolean
remove(DNStateManager sm, Object element, int size, boolean allowDependentField)
Method to remove an element from the collection.boolean
removeAll(DNStateManager sm, Collection elements, int size)
Method to remove a collection of elements from the collection.int
size(DNStateManager sm)
Accessor for the size of the collection.void
update(DNStateManager sm, Collection coll)
Method to update the collection to be the supplied collection of elements.boolean
updateEmbeddedElement(DNStateManager sm, E element, int fieldNumber, Object value)
Method to update en embedded element in the collection.-
Methods inherited from interface org.datanucleus.store.types.scostore.Store
getOwnerMemberMetaData, getStoreManager
-
-
-
-
Method Detail
-
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(DNStateManager sm, E element, int fieldNumber, Object value)
Method to update en embedded element in the collection.- Parameters:
sm
- StateManager for the owner of the collectionelement
- The elementfieldNumber
- Field to update in the elementvalue
- The new value for the field- Returns:
- Whether the element was modified
-
iterator
Iterator<E> iterator(DNStateManager sm)
Accessor for an iterator for the collection.- Parameters:
sm
- StateManager for the owner of the collection.- Returns:
- Iterator for the collection.
-
size
int size(DNStateManager sm)
Accessor for the size of the collection.- Parameters:
sm
- StateManager for the owner of the collection.- Returns:
- The size of the collection.
-
contains
boolean contains(DNStateManager sm, Object element)
Method to check if an element exists in the collection.- Parameters:
sm
- StateManager for the owner of the collection.element
- Element to check- Returns:
- Whether the element exists in the collection.
-
add
boolean add(DNStateManager sm, E element, int size)
Method to add an element to the collection.- Parameters:
sm
- StateManager for the owner of the collection.element
- Element to addsize
- Current size of the collection if known. -1 if not known- Returns:
- Whether the element was added ok
-
addAll
boolean addAll(DNStateManager sm, Collection<E> elements, int size)
Method to add a collection of elements to the collection.- Parameters:
sm
- StateManager for the owner of the collection.elements
- Elements to addsize
- Current size of collection (if known). -1 if not known- Returns:
- Whether the elements were added ok
-
remove
boolean remove(DNStateManager sm, Object element, int size, boolean allowDependentField)
Method to remove an element from the collection.- Parameters:
sm
- StateManager for the owner of the collection.element
- Element to removesize
- Current size of collection if known. -1 if not knownallowDependentField
- Whether to allow any cascading delete actions to be fired from this removal- Returns:
- Whether the element was removed ok
-
removeAll
boolean removeAll(DNStateManager sm, Collection elements, int size)
Method to remove a collection of elements from the collection.- Parameters:
sm
- StateManager for the owner of the collection.elements
- Element to removesize
- Current size of collection if known. -1 if not known- Returns:
- Whether the elements were removed ok
-
clear
void clear(DNStateManager sm)
Method to clear the collection.- Parameters:
sm
- StateManager for the owner of the collection.
-
update
void update(DNStateManager sm, Collection coll)
Method to update the collection to be the supplied collection of elements.- Parameters:
sm
- StateManager of the objectcoll
- The collection to use
-
-