Interface ListStore<E>
-
- Type Parameters:
E
- Element type for this list
- All Superinterfaces:
CollectionStore<E>
,Store
public interface ListStore<E> extends CollectionStore<E>
Interface representation of the backing store for a List. Takes the collection methods and extends them for lists.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(DNStateManager ownerSM, E element, int index, int size)
Method to add an element to the List.boolean
addAll(DNStateManager ownerSM, Collection<E> c, int index, int size)
Method to add a collection of elements to the List.E
get(DNStateManager ownerSM, int index)
Method to retrieve an element from a position in the List.int
indexOf(DNStateManager ownerSM, Object element)
Method to return the position of an element in the List.int
lastIndexOf(DNStateManager ownerSM, Object element)
Method to return the last position of an element in the List.ListIterator<E>
listIterator(DNStateManager ownerSM)
Accessor for a list iterator for the List.E
remove(DNStateManager sm, int index, int size)
Method to remove an element from the List.boolean
removeAll(DNStateManager ownerSM, Collection elements, int size, int[] elementIndices)
Method to remove a collection of elements from the collection.Object
set(DNStateManager ownerSM, int index, Object element, boolean allowDependentField)
Method to update an element at a position in the List.List
subList(DNStateManager ownerSM, int from, int to)
Accessor for a sublist of elements between from and to indices.-
Methods inherited from interface org.datanucleus.store.types.scostore.CollectionStore
add, addAll, clear, contains, hasOrderMapping, iterator, remove, removeAll, size, update, updateEmbeddedElement
-
Methods inherited from interface org.datanucleus.store.types.scostore.Store
getOwnerMemberMetaData, getStoreManager
-
-
-
-
Method Detail
-
add
void add(DNStateManager ownerSM, E element, int index, int size)
Method to add an element to the List.- Parameters:
ownerSM
- StateManager for the owner of the List.element
- Element to addindex
- Position to add the element.size
- Current size of list (if known). -1 if not known
-
addAll
boolean addAll(DNStateManager ownerSM, Collection<E> c, int index, int size)
Method to add a collection of elements to the List.- Parameters:
ownerSM
- StateManager for the owner of the List.c
- Collection of elements to addindex
- Position to add the elements.size
- Current size of the list (if known). -1 if not known- Returns:
- Whether the elements were added ok
-
remove
E remove(DNStateManager sm, int index, int size)
Method to remove an element from the List.- Parameters:
sm
- StateManager for the owner of the List.index
- Position to remove the element.size
- Current size of the list (if known). -1 if not known- Returns:
- The element that was removed.
-
removeAll
boolean removeAll(DNStateManager ownerSM, Collection elements, int size, int[] elementIndices)
Method to remove a collection of elements from the collection.- Parameters:
ownerSM
- StateManager for the owner of the collection.elements
- Element to removesize
- Current size of collection if known. -1 if not knownelementIndices
- Indices where these elements are found (null if not known, or for an ordered list).- Returns:
- Whether the elements were removed ok
-
get
E get(DNStateManager ownerSM, int index)
Method to retrieve an element from a position in the List.- Parameters:
ownerSM
- StateManager for the owner of the List.index
- Position of the element.- Returns:
- The element at that position.
-
set
Object set(DNStateManager ownerSM, int index, Object element, boolean allowDependentField)
Method to update an element at a position in the List.- Parameters:
ownerSM
- StateManager for the owner of the List.index
- Position of the element.element
- The element valueallowDependentField
- Whether to enable dependent field during this operation- Returns:
- The previous element at that position.
-
subList
List subList(DNStateManager ownerSM, int from, int to)
Accessor for a sublist of elements between from and to indices.- Parameters:
ownerSM
- StateManager for the owner of the List.from
- Start position (inclusive)to
- End position (exclusive)- Returns:
- List of elements in this range.
-
indexOf
int indexOf(DNStateManager ownerSM, Object element)
Method to return the position of an element in the List.- Parameters:
ownerSM
- StateManager for the owner of the List.element
- The element value- Returns:
- The position of the element.
-
lastIndexOf
int lastIndexOf(DNStateManager ownerSM, Object element)
Method to return the last position of an element in the List.- Parameters:
ownerSM
- StateManager for the owner of the List.element
- The element value- Returns:
- The last position of the element.
-
listIterator
ListIterator<E> listIterator(DNStateManager ownerSM)
Accessor for a list iterator for the List.- Parameters:
ownerSM
- StateManager for the owner of the List.- Returns:
- List iterator for the List.
-
-