Top Description Fields Constructors Methods
org.eclipse.persistence.internal.identitymaps

public abstract Class AbstractIdentityMapEnumeration<T>

extends Object
implements Enumeration<T>
Class Inheritance
All Implemented Interfaces
java.util.Enumeration
Known Direct Subclasses
org.eclipse.persistence.internal.identitymaps.IdentityMapEnumeration, org.eclipse.persistence.internal.identitymaps.IdentityMapKeyEnumeration
Type Parameters
<T>
type of iterated CacheKey content
Imports
java.util.Collection, .Enumeration, .Iterator, .NoSuchElementException

Abstract Enumeration interface implementation for IdentityMap interface. Allows to iterate over CacheKey instances stored in the map.

Field Summary

Modifier and TypeField and Description
protected final Iterator<CacheKey>
cacheKeysIterator

CacheKey instances iterator.

protected CacheKey
nextKey

Next key to be returned.

protected boolean
shouldCheckReadLocks

Value of true if readLocks should be checked or false otherwise.

Constructor Summary

AccessConstructor and Description
protected
AbstractIdentityMapEnumeration(Collection<CacheKey>
Collection of CacheKey instances to be iterated
keys
,
boolean
value of true if read lock on the CacheKey instances should be checked or false otherwise
shouldCheckReadLocks
)

Creates an instance of CacheKey content enumeration.

Method Summary

Modifier and TypeMethod and Description
private CacheKey

Returns:

next CacheKey instance or null if there is no more instance to provide
getNextCacheKey
()

Get next CacheKey instance from iterator.

protected CacheKey

Returns:

the next element of this enumeration
getNextElement
()

Get next element of CacheKey instances enumeration if this enumeration object has at least one more element to provide.

public boolean

Returns:

value of true if this enumeration object contains at least one more element to provide or false otherwise
hasMoreElements
()

Implements java.util.Enumeration.hasMoreElements.

Check whether this enumeration contains more elements.
public abstract T

Returns:

the next element of this enumeration
nextElement
()

Redeclares java.util.Enumeration.nextElement.

Get next element of CacheKey content enumeration if this enumeration object has at least one more element to provide.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheKeysIteratorback to summary
protected final Iterator<CacheKey> cacheKeysIterator

CacheKey instances iterator.

nextKeyback to summary
protected CacheKey nextKey

Next key to be returned.

shouldCheckReadLocksback to summary
protected boolean shouldCheckReadLocks

Value of true if readLocks should be checked or false otherwise.

Constructor Detail

AbstractIdentityMapEnumerationback to summary
protected AbstractIdentityMapEnumeration(Collection<CacheKey> keys, boolean shouldCheckReadLocks)

Creates an instance of CacheKey content enumeration.

Parameters
keys:Collection<CacheKey>

Collection of CacheKey instances to be iterated

shouldCheckReadLocks:boolean

value of true if read lock on the CacheKey instances should be checked or false otherwise

Method Detail

getNextCacheKeyback to summary
private CacheKey getNextCacheKey()

Get next CacheKey instance from iterator.

Returns:CacheKey

next CacheKey instance or null if there is no more instance to provide

getNextElementback to summary
protected CacheKey getNextElement()

Get next element of CacheKey instances enumeration if this enumeration object has at least one more element to provide.

Returns:CacheKey

the next element of this enumeration

Exceptions
NoSuchElementException:
if no more elements exist
hasMoreElementsback to summary
public boolean hasMoreElements()

Implements java.util.Enumeration.hasMoreElements.

Check whether this enumeration contains more elements.

Returns:boolean

value of true if this enumeration object contains at least one more element to provide or false otherwise

Annotations
@Override
nextElementback to summary
public abstract T nextElement()

Redeclares java.util.Enumeration.nextElement.

Get next element of CacheKey content enumeration if this enumeration object has at least one more element to provide. It it expected that this method will be implemented using getNextElement() in child classes.

Returns:T

the next element of this enumeration

Annotations
@Override
Exceptions
NoSuchElementException:
if no more elements exist