Class NameTokenizer

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class NameTokenizer
    extends java.lang.Object
    implements java.lang.Cloneable
    Tokenizer used for reading TDI attribute names.
    • Constructor Summary

      Constructors 
      Constructor Description
      NameTokenizer()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected NameTokenizer clone()
      int getAfterEndIndex()
      Get the index of the after-end position.
      int getBeforeStartIndex()
      Get the index of the before-start position.
      int getCurrentPosition()
      Returns the current tokenizer position.
      int getNextSeparatorPosition​(char separator)
      Returns the position of the next separator.
      java.lang.String getNextToken​(char separator)
      Returns the string from the current position to the next separator.
      int getPreviousSeparatorPosition​(char separator)
      Returns the position of the previous separator.
      java.lang.String getPreviousToken​(char separator)
      Returns the string from the current position to the previous separator.
      java.util.ListIterator<java.lang.String> listIterator​(char separator)
      Creates a ListIterator for easier work with the Tokenizer..
      void setEscapeChar​(char escapeChar)
      Changes the used escape character.
      void setName​(java.lang.String name)
      Sets the attribute name to be parsed.
      void setName​(java.lang.String name, boolean start)
      Sets the attribute name to be parsed.
      void setName​(java.lang.String name, int position)
      Sets the attribute name to be parsed.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NameTokenizer

        public NameTokenizer()
    • Method Detail

      • setName

        public void setName​(java.lang.String name)
        Sets the attribute name to be parsed.
        Parameters:
        name - attribute name.
      • setName

        public void setName​(java.lang.String name,
                            boolean start)
        Sets the attribute name to be parsed.
        Parameters:
        name - attribute name.
        start - whether the tokenizer should be position at the name start or at its end.
      • setName

        public void setName​(java.lang.String name,
                            int position)
        Sets the attribute name to be parsed.
        Parameters:
        name - attribute name.
        position - starting position.
      • setEscapeChar

        public void setEscapeChar​(char escapeChar)
        Changes the used escape character.
        Parameters:
        escapeChar - escape character.
      • getCurrentPosition

        public int getCurrentPosition()
        Returns the current tokenizer position.
        Returns:
        position.
      • getNextSeparatorPosition

        public int getNextSeparatorPosition​(char separator)
        Returns the position of the next separator.
        Parameters:
        separator - the separator.
        Returns:
        the separator's position.
      • getNextToken

        public java.lang.String getNextToken​(char separator)
        Returns the string from the current position to the next separator. All escaped separators in the resulting string will be replaced by the separator.
        Parameters:
        separator - the separator.
        Returns:
        the resolved string from the current position to the next separator.
      • getPreviousSeparatorPosition

        public int getPreviousSeparatorPosition​(char separator)
        Returns the position of the previous separator.
        Parameters:
        separator - the separator.
        Returns:
        the separator's position.
      • getPreviousToken

        public java.lang.String getPreviousToken​(char separator)
        Returns the string from the current position to the previous separator. All escaped separators in the resulting string will be replaced by the separator.
        Parameters:
        separator - the separator.
        Returns:
        the resolved string from the current position to the previous separator.
      • getBeforeStartIndex

        public final int getBeforeStartIndex()
        Get the index of the before-start position.
        Returns:
        the before-start position's index.
      • getAfterEndIndex

        public final int getAfterEndIndex()
        Get the index of the after-end position.
        Returns:
        the after-end position's index.
      • listIterator

        public java.util.ListIterator<java.lang.String> listIterator​(char separator)
        Creates a ListIterator for easier work with the Tokenizer..
        Parameters:
        separator - the separator to be used by the Iterator.
        Returns:
        the ListIterator.
      • clone

        protected NameTokenizer clone()
        Overrides:
        clone in class java.lang.Object