Package com.j_spaces.kernel
Class AbstractStoredList<T>
java.lang.Object
com.j_spaces.kernel.AbstractStoredList<T>
- All Implemented Interfaces:
IHashEntry<Object,,IStoredList<T>> ICollection<T>,IStoredList<T>,IObjectsList,Iterable<T>
- Direct Known Subclasses:
SimpleLockStoredList
An abstract implementation of the IStoredList, provides common
- Since:
- 6.1
- Author:
- Guy Korland
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.j_spaces.kernel.AbstractStoredList.ObjectInfo<T>protected intprotected intprotected intprotected booleanprotected com.j_spaces.kernel.AbstractStoredList.ObjectInfo<T>protected static final intprotected static final intprotected static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancontains_impl(T obj) voidDump list content, used for Debug.establishListScan(boolean random_scan) establish a scan position.establishListScan(boolean random_scan, boolean alternatingThread) establish a scan position.voidfreeSLHolder(IStoredListIterator<T> slh) this method is called by outside scan that want to quit the scan and return the slholder to the factoryprotected abstract booleanbooleanis the list an iterator or basic list ?booleanis it an actual multi object container.protected abstract booleaniterate(boolean random_scan, StoredListIterator<T> slh) iterator()iterator(boolean randomScan) next(IStoredListIterator<T> slh) get the next element in scan orderabstract booleannextPos(StoredListIterator<T> slh) protected voidremove_impl(com.j_spaces.kernel.AbstractStoredList.ObjectInfo<T> oiToRemove) remove an element described by ObjectInfoprotected booleanprotected com.j_spaces.kernel.AbstractStoredList.ObjectInfo<T>store_impl(T subject) store an elementprotected com.j_spaces.kernel.AbstractStoredList.ObjectInfo<T>storeBeforeCeiling_impl(com.j_spaces.kernel.AbstractStoredList.ObjectInfo<T> theCeiling, T subject) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.j_spaces.kernel.ICollection
add, contains, isEmpty, removeByObject, sizeMethods inherited from interface com.gigaspaces.internal.utils.collections.economy.IHashEntry
getHashCode, getKey, getValue, isNativeHashEntryMethods inherited from interface com.j_spaces.kernel.IStoredList
addUnlocked, getHead, getObjectFromHead, invalidate, optimizeScanForSingleObject, remove, removeUnlockedMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
SCAN_LIMIT
protected static final int SCAN_LIMIT- See Also:
-
NUMBER_OF_OCCUPIED_POS_QUOTA
protected static final int NUMBER_OF_OCCUPIED_POS_QUOTA- See Also:
-
MINIMAL_NUMBER_TO_HANDLE_POSITIONS
protected static final int MINIMAL_NUMBER_TO_HANDLE_POSITIONS- See Also:
-
m_BasicOccupied
-
m_AllOccupiedPos
-
m_Size
protected int m_Size -
m_Support_Random_Scans
protected boolean m_Support_Random_Scans -
m_LastChunk
protected int m_LastChunk -
m_LastPos
protected int m_LastPos -
m_Tail
-
m_Head
-
-
Constructor Details
-
AbstractStoredList
protected AbstractStoredList(boolean Support_Random_Scans)
-
-
Method Details
-
dump
Description copied from interface:IStoredListDump list content, used for Debug.- Specified by:
dumpin interfaceIStoredList<T>- Parameters:
logger- logger to usemsg- message to add in log
-
establishListScan
establish a scan position. if random scanning supported we select a random position- Specified by:
establishListScanin interfaceICollection<T>- Parameters:
random_scan-trueenable random scan;falsestart from head.- Returns:
- a Holder for this scan. This Resource should be released if scan ended prematurely.
-
establishListScan
Description copied from interface:ICollectionestablish a scan position. if random scan is supported we select a random position; otherwise we return the first resource by scanning from head to tail.- Specified by:
establishListScanin interfaceICollection<T>- Parameters:
random_scan-trueenable random scan;falsestart from head.alternatingThread-truethe result iter many be used by a not-same thread- Returns:
- a Holder for this scan. This Resource should be released if scan ended prematurely.
-
iterate
- Parameters:
random_scan-slh-
-
next
get the next element in scan order- Specified by:
nextin interfaceICollection<T>- Parameters:
slh- Holder representing a pivot position.- Returns:
- the next pivot position in this scan;
nullif reached end of scan.
-
nextPos
- Parameters:
slh-
-
freeSLHolder
this method is called by outside scan that want to quit the scan and return the slholder to the factory- Specified by:
freeSLHolderin interfaceIStoredList<T>- Parameters:
slh- Holder resource to return to pool; can benull.
-
removeByObject_impl
-
contains_impl
-
remove_impl
remove an element described by ObjectInfo -
isInvalid
protected abstract boolean isInvalid()- Returns:
- true if the list is invalid
-
store_impl
store an element -
storeBeforeCeiling_impl
-
isMultiObjectCollection
public boolean isMultiObjectCollection()Description copied from interface:ICollectionis it an actual multi object container.- Specified by:
isMultiObjectCollectionin interfaceICollection<T>- Returns:
trueif its an actual list;falseotherwise
-
iterator
-
iterator
-
isIterator
public boolean isIterator()Description copied from interface:IObjectsListis the list an iterator or basic list ?- Specified by:
isIteratorin interfaceIObjectsList
-