Class AbstractIdentityMapEnumeration<T>

java.lang.Object
org.eclipse.persistence.internal.identitymaps.AbstractIdentityMapEnumeration<T>
Type Parameters:
T - type of iterated CacheKey content
All Implemented Interfaces:
Enumeration<T>
Direct Known Subclasses:
IdentityMapEnumeration, IdentityMapKeyEnumeration

public abstract class AbstractIdentityMapEnumeration<T> extends Object implements Enumeration<T>
Abstract Enumeration interface implementation for IdentityMap interface. Allows to iterate over CacheKey instances stored in the map.
  • Field Details

    • cacheKeysIterator

      protected final Iterator<CacheKey> cacheKeysIterator
      CacheKey instances iterator.
    • nextKey

      protected CacheKey nextKey
      Next key to be returned.
    • shouldCheckReadLocks

      protected boolean shouldCheckReadLocks
      Value of true if readLocks should be checked or false otherwise.
  • Constructor Details

    • AbstractIdentityMapEnumeration

      protected AbstractIdentityMapEnumeration(Collection<CacheKey> keys, boolean shouldCheckReadLocks)
      Creates an instance of CacheKey content enumeration.
      Parameters:
      keys - Collection of CacheKey instances to be iterated
      shouldCheckReadLocks - value of true if read lock on the CacheKey instances should be checked or false otherwise
  • Method Details

    • hasMoreElements

      public boolean hasMoreElements()
      Check whether this enumeration contains more elements.
      Specified by:
      hasMoreElements in interface Enumeration<T>
      Returns:
      value of true if this enumeration object contains at least one more element to provide or false otherwise
    • nextElement

      public abstract T 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.
      Specified by:
      nextElement in interface Enumeration<T>
      Returns:
      the next element of this enumeration
      Throws:
      NoSuchElementException - if no more elements exist
    • getNextElement

      protected CacheKey getNextElement()
      Get next element of CacheKey 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