Package com.j_spaces.kernel
Interface ICollection<T>
- All Known Subinterfaces:
IEntryCacheInfo,IOrderedList<T>,IStoredList<T>
- All Known Implementing Classes:
AbstractStoredList,BlobStoreRefEntryCacheInfo,ConcurrentSegmentedStoredList,ConcurrentSegmentedStoredListHashmapEntry,ConcurrentStoredList,EvictableEntryCacheInfo,ExternallyLockedStoredList,HashedSimpleLockIStoredList,MemoryBasedEntryCacheInfo,MVCCEntryCacheInfo,MVCCShellEntryCacheInfo,RwlSegmentedStoredList,SimpleLockStoredList,TemplateCacheInfo
public interface ICollection<T>
Interface for all internal collections.
- Since:
- 6.1
- Author:
- anna
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionStore an element in the list.booleanChecks whether it contains the specified element.establishListScan(boolean random_scan) establish a scan position.default IStoredListIterator<T>establishListScan(boolean random_scan, boolean alternatingThread) establish a scan position.booleanisEmpty()Returns true if this list is empty, i.e.booleanis it an actual multi object container.next(IStoredListIterator<T> slh) Returns the next element in the scan order.booleanremoveByObject(T obj) Given an element scan the list, find it and remove it.intsize()Returns the amount of elements in the StoredList.
-
Method Details
-
size
int size()Returns the amount of elements in the StoredList.- Returns:
- size of the StoredList
- See Also:
-
isEmpty
boolean isEmpty()Returns true if this list is empty, i.e. has no elements. [Tail] - [Head]- Returns:
trueif list is empty;falseotherwise.
-
establishListScan
establish 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.- 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
establish 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.- 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.
-
next
Returns the next element in the scan order. Calling this method until it returns null, will return each element as part of theSLHolders subject.- Parameters:
slh- Holder representing a pivot position.- Returns:
- the next pivot position in this scan;
nullif reached end of scan.
-
add
Store an element in the list. New elements are inserted at the tail.- Parameters:
subject- element to store.- Returns:
- an information node representing the inserted element;
nullif StoredList has been invalidated.
-
removeByObject
Given an element scan the list, find it and remove it.- Parameters:
obj- element to remove- Returns:
trueif object was removed;falseotherwise (if element wasn't found)
-
contains
Checks whether it contains the specified element.- Parameters:
obj- the element to search for- Returns:
trueif element exists in the StoredList;falseotherwise.
-
isMultiObjectCollection
boolean isMultiObjectCollection()is it an actual multi object container.- Returns:
trueif its an actual list;falseotherwise
-