Class SubsetConfiguration.SubsetIterator

  • All Implemented Interfaces:
    java.util.Iterator<java.lang.String>
    Enclosing class:
    SubsetConfiguration

    private final class SubsetConfiguration.SubsetIterator
    extends java.lang.Object
    implements java.util.Iterator<java.lang.String>
    A specialized iterator to be returned by the getKeys() methods. This implementation wraps an iterator from the parent configuration. The keys returned by this iterator are correspondingly transformed.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Iterator<java.lang.String> parentIterator
      Stores the wrapped iterator.
    • Constructor Summary

      Constructors 
      Constructor Description
      SubsetIterator​(java.util.Iterator<java.lang.String> it)
      Creates a new instance of SubsetIterator and initializes it with the parent iterator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()
      Checks whether there are more elements.
      java.lang.String next()
      Returns the next element in the iteration.
      void remove()
      Removes the current element from the iteration.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Field Detail

      • parentIterator

        private final java.util.Iterator<java.lang.String> parentIterator
        Stores the wrapped iterator.
    • Constructor Detail

      • SubsetIterator

        public SubsetIterator​(java.util.Iterator<java.lang.String> it)
        Creates a new instance of SubsetIterator and initializes it with the parent iterator.
        Parameters:
        it - the iterator of the parent configuration
    • Method Detail

      • hasNext

        public boolean hasNext()
        Checks whether there are more elements. Delegates to the parent iterator.
        Specified by:
        hasNext in interface java.util.Iterator<java.lang.String>
        Returns:
        a flag whether there are more elements
      • next

        public java.lang.String next()
        Returns the next element in the iteration. This is the next key from the parent configuration, transformed to correspond to the point of view of this subset configuration.
        Specified by:
        next in interface java.util.Iterator<java.lang.String>
        Returns:
        the next element
      • remove

        public void remove()
        Removes the current element from the iteration. Delegates to the parent iterator.
        Specified by:
        remove in interface java.util.Iterator<java.lang.String>