org.basex.util
Class TokenIterator

java.lang.Object
  extended by org.basex.util.TokenIterator

public final class TokenIterator
extends java.lang.Object

This class allows the iteration on tokens.

Author:
Workgroup DBIS, University of Konstanz 2005-07, ISC License, Christian Gruen

Constructor Summary
TokenIterator(byte[] t)
          Constructor.
 
Method Summary
 boolean contains(byte[] tok)
          Check if the current token contains the specified token.
 int cp(int i)
          Returns the specified character.
 byte get(int i)
          Returns the specified character, starting from the current position.
 void init()
          Initializes the iterator.
 int len(int i)
          Returns the specified character length.
 void mark()
          Remembers the current position.
 java.lang.String marked()
          Returns the marked string.
 boolean more()
          Checks if the text has more words to print.
 java.lang.String next()
          Returns the next token.
 int size()
          Returns the size of the current character.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenIterator

public TokenIterator(byte[] t)
Constructor.

Parameters:
t - text
Method Detail

contains

public boolean contains(byte[] tok)
Check if the current token contains the specified token.

Parameters:
tok - token to be checked
Returns:
result of check

cp

public int cp(int i)
Returns the specified character.

Parameters:
i - character position
Returns:
current character

get

public byte get(int i)
Returns the specified character, starting from the current position.

Parameters:
i - character position
Returns:
current character

init

public void init()
Initializes the iterator.


len

public int len(int i)
Returns the specified character length.

Parameters:
i - character position
Returns:
character length

mark

public void mark()
Remembers the current position.


marked

public java.lang.String marked()
Returns the marked string.

Returns:
marked string

more

public boolean more()
Checks if the text has more words to print.

Returns:
true if the text has more words

next

public java.lang.String next()
Returns the next token.

Returns:
next token

size

public int size()
Returns the size of the current character.

Returns:
current size