Class AbstractIdentityMapEnumeration<T>

  • Type Parameters:
    T - type of iterated CacheKey content
    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>
    Abstract Enumeration interface implementation for IdentityMap interface. Allows to iterate over CacheKey instances stored in the map.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected CacheKey getNextElement()
      Get next element of CacheKey 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 of CacheKey content 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
    • Field Detail

      • cacheKeysIterator

        protected final java.util.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 Detail

      • AbstractIdentityMapEnumeration

        public AbstractIdentityMapEnumeration​(java.util.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 Detail

      • hasMoreElements

        public boolean hasMoreElements()
        Check whether this enumeration contains more elements.
        Specified by:
        hasMoreElements in interface java.util.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 java.util.Enumeration<T>
        Returns:
        the next element of this enumeration
        Throws:
        java.util.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:
        java.util.NoSuchElementException - if no more elements exist