Class CharRange.CharacterIterator

  • All Implemented Interfaces:
    java.util.Iterator
    Enclosing class:
    CharRange

    private static class CharRange.CharacterIterator
    extends java.lang.Object
    implements java.util.Iterator
    Character Iterator.

    #NotThreadSafe#

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private char current
      The current character
      private boolean hasNext  
      private CharRange range  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private CharacterIterator​(CharRange r)
      Construct a new iterator for the character range.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()
      Has the iterator not reached the end character yet?
      java.lang.Object next()
      Return the next character in the iteration
      private void prepareNext()
      Prepare the next character in the range.
      void remove()
      Always throws UnsupportedOperationException.
      • 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

      • current

        private char current
        The current character
      • hasNext

        private boolean hasNext
    • Constructor Detail

      • CharacterIterator

        private CharacterIterator​(CharRange r)
        Construct a new iterator for the character range.
        Parameters:
        r - The character range
    • Method Detail

      • prepareNext

        private void prepareNext()
        Prepare the next character in the range.
      • hasNext

        public boolean hasNext()
        Has the iterator not reached the end character yet?
        Specified by:
        hasNext in interface java.util.Iterator
        Returns:
        true if the iterator has yet to reach the character date
      • next

        public java.lang.Object next()
        Return the next character in the iteration
        Specified by:
        next in interface java.util.Iterator
        Returns:
        Character for the next character
      • remove

        public void remove()
        Always throws UnsupportedOperationException.
        Specified by:
        remove in interface java.util.Iterator
        Throws:
        java.lang.UnsupportedOperationException
        See Also:
        Iterator.remove()