Package one.microstream.collections
Class AbstractSectionedArrayCollection<E>
java.lang.Object
one.microstream.collections.AbstractExtendedCollection<E>
one.microstream.collections.AbstractArrayCollection<E>
one.microstream.collections.AbstractSectionedArrayCollection<E>
- Type Parameters:
E
- type of contained elements
- All Implemented Interfaces:
ExtendedCollection<E>
,Sized
- Direct Known Subclasses:
AbstractSimpleArrayCollection
public abstract class AbstractSectionedArrayCollection<E> extends AbstractArrayCollection<E>
-
Nested Class Summary
Nested classes/interfaces inherited from interface one.microstream.collections.interfaces.ExtendedCollection
ExtendedCollection.Creator<E,C extends ExtendedCollection<E>>
-
Constructor Summary
Constructors Constructor Description AbstractSectionedArrayCollection()
-
Method Summary
Modifier and Type Method Description protected abstract int[]
internalGetSectionIndices()
Defines the array sections in which the collection's elements are organized by one or more pairs of indices in the order corresponding to the collection's logical order of its contained elements.protected abstract E[]
internalGetStorageArray()
This is an internal shortcut method to provide fast access to the various array-backed collection implementations' storage arrays.
The purpose of this method is to allow access to the array only for read-only procedures, never for modifying accesses.Methods inherited from class one.microstream.collections.AbstractArrayCollection
marker, newArray, newArray, pow2BoundMaxed
Methods inherited from class one.microstream.collections.AbstractExtendedCollection
ensureFreeArrayCapacity, internalCountingAddAll, internalCountingAddAll, internalCountingAddAll, internalCountingPutAll, internalCountingPutAll, internalCountingPutAll, validateIndex
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface one.microstream.collections.interfaces.ExtendedCollection
hasVolatileElements, nullAllowed
-
Constructor Details
-
AbstractSectionedArrayCollection
public AbstractSectionedArrayCollection()
-
-
Method Details
-
internalGetStorageArray
This is an internal shortcut method to provide fast access to the various array-backed collection implementations' storage arrays.
The purpose of this method is to allow access to the array only for read-only procedures, never for modifying accesses.The returned array is expected to contain the elements of the list in an order defined by the sectionIndices provided by
internalGetSectionIndices()
- Specified by:
internalGetStorageArray
in classAbstractArrayCollection<E>
- Returns:
- the storage array used by the list, containing all elements in sectioned order.
-
internalGetSectionIndices
protected abstract int[] internalGetSectionIndices()Defines the array sections in which the collection's elements are organized by one or more pairs of indices in the order corresponding to the collection's logical order of its contained elements.Examples:
The trivial example would be {0,size} in case of standard sized array collections.
An example for actual sectioning would be {i,array.length - 1, 0,i - 1} in case of a ring buffer list comprised of two sections: one ranging from index i to array.length - 1 (with the oldest element located at i) and one ranging from 0 to i - 1 (with the newest element located at i - 1).- Returns:
- a list of index pairs defining all sections of the storage array in logical order.
-