Class AbstractIdentityMapEnumeration<T>
- java.lang.Object
-
- org.eclipse.persistence.internal.identitymaps.AbstractIdentityMapEnumeration<T>
-
- Type Parameters:
T
- type of iteratedCacheKey
content
- All Implemented Interfaces:
Enumeration<T>
- Direct Known Subclasses:
IdentityMapEnumeration
,IdentityMapKeyEnumeration
public abstract class AbstractIdentityMapEnumeration<T> extends Object implements Enumeration<T>
AbstractEnumeration
interface implementation forIdentityMap
interface. Allows to iterate overCacheKey
instances stored in the map.
-
-
Field Summary
Fields Modifier and Type Field Description protected Iterator<CacheKey>
cacheKeysIterator
CacheKey
instances iterator.protected CacheKey
nextKey
Next key to be returned.protected boolean
shouldCheckReadLocks
Value oftrue
if readLocks should be checked or false otherwise.
-
Constructor Summary
Constructors Constructor Description AbstractIdentityMapEnumeration(Collection<CacheKey> keys, boolean shouldCheckReadLocks)
Creates an instance ofCacheKey
content enumeration.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected CacheKey
getNextElement()
Get next element ofCacheKey
instances enumeration if this enumeration object has at least one more element to provide.boolean
hasMoreElements()
Check whether this enumeration contains more elements.abstract T
nextElement()
Get next element ofCacheKey
content enumeration if this enumeration object has at least one more element to provide.
-
-
-
Constructor Detail
-
AbstractIdentityMapEnumeration
public AbstractIdentityMapEnumeration(Collection<CacheKey> keys, boolean shouldCheckReadLocks)
Creates an instance ofCacheKey
content enumeration.- Parameters:
keys
-Collection
ofCacheKey
instances to be iteratedshouldCheckReadLocks
- value oftrue
if read lock on theCacheKey
instances should be checked orfalse
otherwise
-
-
Method Detail
-
hasMoreElements
public boolean hasMoreElements()
Check whether this enumeration contains more elements.- Specified by:
hasMoreElements
in interfaceEnumeration<T>
- Returns:
- value of
true
if this enumeration object contains at least one more element to provide orfalse
otherwise
-
nextElement
public abstract T nextElement()
Get next element ofCacheKey
content 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:
nextElement
in interfaceEnumeration<T>
- Returns:
- the next element of this enumeration
- Throws:
NoSuchElementException
- if no more elements exist
-
getNextElement
protected CacheKey getNextElement()
Get next element ofCacheKey
instances 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
-
-