Class AbstractIdentityMapEnumeration<T>
- java.lang.Object
-
- org.eclipse.persistence.internal.identitymaps.AbstractIdentityMapEnumeration<T>
-
- Type Parameters:
T- type of iteratedCacheKeycontent
- All Implemented Interfaces:
java.util.Enumeration<T>
- Direct Known Subclasses:
IdentityMapEnumeration,IdentityMapKeyEnumeration
public abstract class AbstractIdentityMapEnumeration<T> extends java.lang.Object implements java.util.Enumeration<T>AbstractEnumerationinterface implementation forIdentityMapinterface. Allows to iterate overCacheKeyinstances stored in the map.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Iterator<CacheKey>cacheKeysIteratorCacheKeyinstances iterator.protected CacheKeynextKeyNext key to be returned.protected booleanshouldCheckReadLocksValue oftrueif readLocks should be checked or false otherwise.
-
Constructor Summary
Constructors Constructor Description AbstractIdentityMapEnumeration(java.util.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.
-
-
-
Field Detail
-
cacheKeysIterator
protected final java.util.Iterator<CacheKey> cacheKeysIterator
CacheKeyinstances iterator.
-
nextKey
protected CacheKey nextKey
Next key to be returned.
-
shouldCheckReadLocks
protected boolean shouldCheckReadLocks
Value oftrueif readLocks should be checked or false otherwise.
-
-
Method Detail
-
hasMoreElements
public boolean hasMoreElements()
Check whether this enumeration contains more elements.- Specified by:
hasMoreElementsin interfacejava.util.Enumeration<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 interfacejava.util.Enumeration<T>- Returns:
- the next element of this enumeration
- Throws:
java.util.NoSuchElementException- if no more elements exist
-
-