com.ibm.di.entry
Class NameTokenizer

java.lang.Object
  extended by com.ibm.di.entry.NameTokenizer
All Implemented Interfaces:
Cloneable

public class NameTokenizer
extends Object
implements Cloneable

Tokenizer used for reading TDI attribute names.


Constructor Summary
NameTokenizer()
           
 
Method Summary
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.
 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.
 String getPreviousToken(char separator)
          Returns the string from the current position to the previous separator.
 ListIterator<String> listIterator(char separator)
          Creates a ListIterator for easier work with the Tokenizer..
 void setEscapeChar(char escapeChar)
          Changes the used escape character.
 void setName(String name)
          Sets the attribute name to be parsed.
 void setName(String name, boolean start)
          Sets the attribute name to be parsed.
 void setName(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(String name)
Sets the attribute name to be parsed.

Parameters:
name - attribute name.

setName

public void setName(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(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 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 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 ListIterator<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 Object