Class CharRange.CharacterIterator

  • All Implemented Interfaces:
    java.util.Iterator<java.lang.Character>
    Enclosing class:
    CharRange

    private static class CharRange.CharacterIterator
    extends java.lang.Object
    implements java.util.Iterator<java.lang.Character>
    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)
      Constructs 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.Character next()
      Returns the next character in the iteration
      private void prepareNext()
      Prepares 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)
        Constructs a new iterator for the character range.
        Parameters:
        r - The character range
    • Method Detail

      • prepareNext

        private void prepareNext()
        Prepares 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<java.lang.Character>
        Returns:
        true if the iterator has yet to reach the character date
      • next

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

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