Package net.sf.xslthl

Class CharIter

  • All Implemented Interfaces:
    java.lang.Iterable<java.lang.Character>, java.util.Iterator<java.lang.Character>

    public class CharIter
    extends java.lang.Object
    implements java.lang.Iterable<java.lang.Character>, java.util.Iterator<java.lang.Character>
    A special character iterator
    • Constructor Summary

      Constructors 
      Constructor Description
      CharIter​(java.lang.String input)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.regex.Matcher createMatcher​(java.util.regex.Pattern pattern)
      Create a pattern matcher
      java.lang.Character current()  
      boolean finished()  
      int getLength()  
      int getMark()  
      java.lang.String getMarked()  
      int getPosition()  
      boolean hasNext()  
      int indexOf​(java.lang.String substr)  
      boolean isMarked()  
      java.util.Iterator<java.lang.Character> iterator()  
      Block markedToBlock()  
      Block markedToStyledBlock​(java.lang.String styleName)
      Create a style block, unless the stylename is equale to "none"
      void moveNext()
      Increase the pointer
      void moveNext​(int offset)
      Increase the point with the given offset
      void moveNextAndMark()
      Increase the pointer and mark the position after it
      void moveToEnd()
      Move to the end of the string
      java.lang.Character next()  
      java.lang.Character next​(int offset)  
      java.lang.Character prev()  
      java.lang.Character prev​(int offset)  
      int remaining()  
      void remove()  
      void setMark()
      Set the current position as the mark
      void setMark​(int newMark)
      Set the mark to the given location
      boolean startsWith​(java.lang.String prefix)  
      boolean startsWith​(java.lang.String prefix, boolean ignoreCase)  
      boolean startsWith​(java.lang.String prefix, int diff)  
      boolean startsWith​(java.lang.String prefix, int diff, boolean ignoreCase)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Constructor Detail

      • CharIter

        public CharIter​(java.lang.String input)
    • Method Detail

      • getMark

        public int getMark()
        Returns:
        the marked position
      • setMark

        public void setMark()
        Set the current position as the mark
      • setMark

        public void setMark​(int newMark)
        Set the mark to the given location
        Parameters:
        newMark -
      • isMarked

        public boolean isMarked()
        Returns:
        true if there is a mark set
      • getMarked

        public java.lang.String getMarked()
        Returns:
        the marked section
      • markedToBlock

        public Block markedToBlock()
        Returns:
        the marked string as a block
      • markedToStyledBlock

        public Block markedToStyledBlock​(java.lang.String styleName)
        Create a style block, unless the stylename is equale to "none"
        Parameters:
        styleName -
        Returns:
        the marked string as a styled block
      • moveNext

        public void moveNext()
        Increase the pointer
      • moveNext

        public void moveNext​(int offset)
        Increase the point with the given offset
        Parameters:
        offset -
      • moveNextAndMark

        public void moveNextAndMark()
        Increase the pointer and mark the position after it
      • moveToEnd

        public void moveToEnd()
        Move to the end of the string
      • finished

        public boolean finished()
        Returns:
        true if the iterator finished
      • current

        public java.lang.Character current()
        Returns:
        the current character
      • next

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

        public java.lang.Character next​(int offset)
        Parameters:
        offset -
        Returns:
        the characters at the given offset
      • prev

        public java.lang.Character prev()
        Returns:
        the previous character
      • prev

        public java.lang.Character prev​(int offset)
        Parameters:
        offset -
        Returns:
        the previous character at a given offset
      • startsWith

        public boolean startsWith​(java.lang.String prefix)
        Parameters:
        prefix -
        Returns:
        true if the current position starts with the prefix
      • startsWith

        public boolean startsWith​(java.lang.String prefix,
                                  boolean ignoreCase)
        Parameters:
        prefix -
        ignoreCase -
        Returns:
        true if the current position starts with the prefix
      • startsWith

        public boolean startsWith​(java.lang.String prefix,
                                  int diff)
        Parameters:
        prefix -
        diff -
        Returns:
        true if the current position starts with the prefix at a given offset
      • startsWith

        public boolean startsWith​(java.lang.String prefix,
                                  int diff,
                                  boolean ignoreCase)
        Parameters:
        prefix -
        diff -
        ignoreCase -
        Returns:
        true if the current position starts with the prefix at a given offset
      • createMatcher

        public java.util.regex.Matcher createMatcher​(java.util.regex.Pattern pattern)
        Create a pattern matcher
        Parameters:
        pattern -
      • getPosition

        public int getPosition()
        Returns:
      • getLength

        public int getLength()
        Returns:
      • remaining

        public int remaining()
        Returns:
        the remaining characters in the buffer
      • indexOf

        public int indexOf​(java.lang.String substr)
        Parameters:
        substr -
        Returns:
        the index of the given string
      • iterator

        public java.util.Iterator<java.lang.Character> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.Character>
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<java.lang.Character>
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<java.lang.Character>