Class TokenIterator

  • All Implemented Interfaces:
    java.util.Iterator<Token>

    class TokenIterator
    extends java.lang.Object
    implements java.util.Iterator<Token>
    Allows you to iterate through all paintable tokens in an RSyntaxDocument.
    Version:
    1.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private int getLineCount()  
      boolean hasNext()
      Returns whether any more paintable tokens are in the document.
      private void loadTokenListForCurLine()  
      Token next()
      Returns the next paintable token in the document.
      void remove()
      Always throws UnsupportedOperationException, as Token removal is not supported.
      • 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
    • Constructor Detail

      • TokenIterator

        TokenIterator​(RSyntaxDocument doc)
        Constructor.
        Parameters:
        doc - The document whose tokens we should iterate over.
    • Method Detail

      • getLineCount

        private int getLineCount()
      • hasNext

        public boolean hasNext()
        Returns whether any more paintable tokens are in the document.
        Specified by:
        hasNext in interface java.util.Iterator<Token>
        Returns:
        Whether there are any more paintable tokens.
        See Also:
        next()
      • loadTokenListForCurLine

        private void loadTokenListForCurLine()
      • next

        public Token next()
        Returns the next paintable token in the document.
        Specified by:
        next in interface java.util.Iterator<Token>
        Returns:
        The next paintable token in the document.
        See Also:
        hasNext()
      • remove

        public void remove()
        Always throws UnsupportedOperationException, as Token removal is not supported.
        Specified by:
        remove in interface java.util.Iterator<Token>
        Throws:
        java.lang.UnsupportedOperationException - always.