Module org.eclipse.persistence.core
Class AbstractIdentityMapEnumeration<T>
- java.lang.Object
-
- org.eclipse.persistence.internal.identitymaps.AbstractIdentityMapEnumeration<T>
-
- Type Parameters:
T- type of iteratedCacheKeycontent
- All Implemented Interfaces:
Enumeration<T>
- Direct Known Subclasses:
IdentityMapEnumeration,IdentityMapKeyEnumeration
public abstract class AbstractIdentityMapEnumeration<T> extends Object implements Enumeration<T>
AbstractEnumerationinterface implementation forIdentityMapinterface. Allows to iterate overCacheKeyinstances stored in the map.
-
-
Field Summary
Fields Modifier and Type Field Description protected Iterator<CacheKey>cacheKeysIteratorCacheKeyinstances iterator.protected CacheKeynextKeyNext key to be returned.protected booleanshouldCheckReadLocksValue oftrueif readLocks should be checked or false otherwise.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractIdentityMapEnumeration(Collection<CacheKey> keys, boolean shouldCheckReadLocks)Creates an instance ofCacheKeycontent enumeration.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected CacheKeygetNextElement()Get next element ofCacheKeyinstances enumeration if this enumeration object has at least one more element to provide.booleanhasMoreElements()Check whether this enumeration contains more elements.abstract TnextElement()Get next element ofCacheKeycontent enumeration if this enumeration object has at least one more element to provide.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Enumeration
asIterator
-
-
-
-
Constructor Detail
-
AbstractIdentityMapEnumeration
protected AbstractIdentityMapEnumeration(Collection<CacheKey> keys, boolean shouldCheckReadLocks)
Creates an instance ofCacheKeycontent enumeration.- Parameters:
keys-CollectionofCacheKeyinstances to be iteratedshouldCheckReadLocks- value oftrueif read lock on theCacheKeyinstances should be checked orfalseotherwise
-
-
Method Detail
-
hasMoreElements
public boolean hasMoreElements()
Check whether this enumeration contains more elements.- Specified by:
hasMoreElementsin interfaceEnumeration<T>- Returns:
- value of
trueif this enumeration object contains at least one more element to provide orfalseotherwise
-
nextElement
public abstract T nextElement()
Get next element ofCacheKeycontent enumeration if this enumeration object has at least one more element to provide. It it expected that this method will be implemented usinggetNextElement()in child classes.- Specified by:
nextElementin interfaceEnumeration<T>- Returns:
- the next element of this enumeration
- Throws:
NoSuchElementException- if no more elements exist
-
getNextElement
protected CacheKey getNextElement()
Get next element ofCacheKeyinstances enumeration if this enumeration object has at least one more element to provide.- Returns:
- the next element of this enumeration
- Throws:
NoSuchElementException- if no more elements exist
-
-