Package com.j_spaces.kernel.list
Class RwlSegmentedStoredList<T>
java.lang.Object
com.j_spaces.kernel.list.RwlSegmentedStoredList<T>
- All Implemented Interfaces:
IHashEntry<Object,,IStoredList<T>> ICollection<T>,IStoredList<T>,IObjectsList
Deprecated.
segmented Read/Write Lock version of StoredList to be used with JDK 1.5+ NOTE : some of the apis
of IStoredList are not supported used just for shortest path selected fifo & order related apis
not supported
- Since:
- 6.1
- Version:
- 1.0
- Author:
- Yechiel Fefer
-
Constructor Summary
ConstructorsConstructorDescriptionRwlSegmentedStoredList(IReusableResourcePool<ReadWriteLock> locksPool) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.store an elementaddUnlocked(T subject) Deprecated.Store an element in the list, while the SL is unlocked .booleanDeprecated.is this object contained in the SL ?voidDeprecated.Dump list content, used for Debug.establishListScan(boolean random_scan) Deprecated.establish a scan position.voidfreeSLHolder(IStoredListIterator<T> slh) Deprecated.this method is called by outside scan that want to quit the scan and return the slholder to the factoryintgetHashCode(int id) Deprecated.getHead()Deprecated.Goes over all the segments and finds the first element.getKey(int id) Deprecated.Deprecated.Returns the value of the first element in the list (fifo)getValue(int id) Deprecated.booleanDeprecated.Sets an indication that this StoredList is invalid.booleanisEmpty()Deprecated.Returns true if the list is emptybooleanDeprecated.is the list an iterator or basic list ?booleanDeprecated.is it an actual multi object container.booleanDeprecated.next(IStoredListIterator<T> slh) Deprecated.get the next element in scan orderbooleanDeprecated.return true if we can save iterator creation and get a single entryvoidremove(IObjectInfo<T> poi) Deprecated.remove an element described by ObjectInfoprotected voidremove_impl(com.j_spaces.kernel.list.RwlSegmentedStoredList.Segment<T> segment, com.j_spaces.kernel.list.RwlSegmentedStoredList.ObjectInfo<T> oi) Deprecated.remove an element described by ObjectInfobooleanremoveByObject(T obj) Deprecated.given an object scan the list, find it and remove it, returns true if foundvoidremoveUnlocked(IObjectInfo<T> poi) Deprecated.Remove an element described by ObjectInfo, while the SL is unlocked.intsize()Deprecated.Returns the amount of elements in the StoredList.protected IObjectInfo<T>store_impl(com.j_spaces.kernel.list.RwlSegmentedStoredList.Segment<T> segment, com.j_spaces.kernel.list.RwlSegmentedStoredList.ObjectInfo<T> oi) Deprecated.store an element in segmentMethods 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
establishListScan
-
Constructor Details
-
RwlSegmentedStoredList
Deprecated.
-
-
Method Details
-
size
public int size()Deprecated.Description copied from interface:ICollectionReturns the amount of elements in the StoredList.- Specified by:
sizein interfaceICollection<T>- Returns:
- size of the StoredList
- See Also:
-
isEmpty
public boolean isEmpty()Deprecated.Returns true if the list is empty- Specified by:
isEmptyin interfaceICollection<T>- Returns:
trueif list is empty;falseotherwise.
-
getHead
Deprecated.Goes over all the segments and finds the first element.- Specified by:
getHeadin interfaceIStoredList<T>- Returns:
- the head of the list
-
getObjectFromHead
Deprecated.Description copied from interface:IStoredListReturns the value of the first element in the list (fifo)- Specified by:
getObjectFromHeadin interfaceIStoredList<T>- Returns:
- the value of the head of the list
-
optimizeScanForSingleObject
public boolean optimizeScanForSingleObject()Deprecated.return true if we can save iterator creation and get a single entry- Specified by:
optimizeScanForSingleObjectin interfaceIStoredList<T>- Returns:
- true if we can optimize
-
establishListScan
Deprecated.establish a scan position. we select a random segment to start from- 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.
-
next
Deprecated.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.
-
freeSLHolder
Deprecated.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.
-
add
Deprecated.store an element- Specified by:
addin interfaceICollection<T>- Parameters:
subject- element to store.- Returns:
- an information node representing the inserted element;
nullif StoredList has been invalidated.
-
addUnlocked
Deprecated.Description copied from interface:IStoredListStore an element in the list, while the SL is unlocked . New elements are inserted at the tail.- Specified by:
addUnlockedin interfaceIStoredList<T>- Parameters:
subject- element to store.- Returns:
- an information node representing the inserted element;
nullif StoredList has been invalidated.
-
store_impl
protected IObjectInfo<T> store_impl(com.j_spaces.kernel.list.RwlSegmentedStoredList.Segment<T> segment, com.j_spaces.kernel.list.RwlSegmentedStoredList.ObjectInfo<T> oi) Deprecated.store an element in segment -
remove
Deprecated.remove an element described by ObjectInfo- Specified by:
removein interfaceIStoredList<T>- Parameters:
poi- an existing element between Tail and Head
-
removeUnlocked
Deprecated.Description copied from interface:IStoredListRemove an element described by ObjectInfo, while the SL is unlocked. [Tail] - .. - [beforeOi] - [oi] - [afterOi] - .. - [Head]- Specified by:
removeUnlockedin interfaceIStoredList<T>- Parameters:
poi- an existing element between Tail and Head
-
remove_impl
protected void remove_impl(com.j_spaces.kernel.list.RwlSegmentedStoredList.Segment<T> segment, com.j_spaces.kernel.list.RwlSegmentedStoredList.ObjectInfo<T> oi) Deprecated.remove an element described by ObjectInfo- Parameters:
segment- TODO
-
removeByObject
Deprecated.given an object scan the list, find it and remove it, returns true if found- Specified by:
removeByObjectin interfaceICollection<T>- Parameters:
obj- element to remove- Returns:
trueif object was removed;falseotherwise (if element wasn't found)
-
contains
Deprecated.is this object contained in the SL ?- Specified by:
containsin interfaceICollection<T>- Parameters:
obj- the element to search for- Returns:
trueif element exists in the StoredList;falseotherwise.
-
invalidate
public boolean invalidate()Deprecated.Sets an indication that this StoredList is invalid. if isEmpty() returns true, the indication is set; otherwise the indication remains false. Called by PersistentGC when scanning for empty StoredList that can be garbage collected.- Specified by:
invalidatein interfaceIStoredList<T>- Returns:
trueif StoredList was set to invalid;falseotherwise.
-
isMultiObjectCollection
public boolean isMultiObjectCollection()Deprecated.Description copied from interface:ICollectionis it an actual multi object container.- Specified by:
isMultiObjectCollectionin interfaceICollection<T>- Returns:
trueif its an actual list;falseotherwise
-
isIterator
public boolean isIterator()Deprecated.Description copied from interface:IObjectsListis the list an iterator or basic list ?- Specified by:
isIteratorin interfaceIObjectsList
-
dump
Deprecated.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
-
getHashCode
public int getHashCode(int id) Deprecated.- Specified by:
getHashCodein interfaceIHashEntry<Object,IStoredList<T>>
-
getKey
Deprecated.- Specified by:
getKeyin interfaceIHashEntry<Object,IStoredList<T>>
-
getValue
Deprecated.- Specified by:
getValuein interfaceIHashEntry<Object,IStoredList<T>>
-
isNativeHashEntry
public boolean isNativeHashEntry()Deprecated.- Specified by:
isNativeHashEntryin interfaceIHashEntry<Object,IStoredList<T>> - Returns:
trueif this is a native hashmap entry
-