lt.monarch.math
Class AbstractTokenizer

java.lang.Object
  extended by lt.monarch.math.AbstractTokenizer
Direct Known Subclasses:
FormulaTokenizer, LogicalTokenizer

public abstract class AbstractTokenizer
extends java.lang.Object

Abstract tokenizer class. It determines the interface of the formula and logical tokenizers.


Field Summary
Modifier and Type Field and Description
protected  java.lang.String token
          Last found token in the formula
 
Constructor Summary
Constructor and Description
AbstractTokenizer()
           
 
Method Summary
Modifier and Type Method and Description
abstract  void dispose()
          Disposes the tokenizer
abstract  int getPosition()
          Returns the position of the tokenizer.
abstract  java.lang.String getPreviousToken()
          Return the previous token.
abstract  boolean hasMoreTokens()
          Checks if the string has more tokens
 boolean isLeftBracket()
          Checks if the last string is the left bracket.
 boolean isRightBracket()
          Checks if the last token is the right bracket.
abstract  java.lang.String nextToken()
          Returns next token
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token

protected java.lang.String token
Last found token in the formula

Constructor Detail

AbstractTokenizer

public AbstractTokenizer()
Method Detail

hasMoreTokens

public abstract boolean hasMoreTokens()
Checks if the string has more tokens

Returns:
true if has more tokens

nextToken

public abstract java.lang.String nextToken()
Returns next token

Returns:
Next token

getPreviousToken

public abstract java.lang.String getPreviousToken()
Return the previous token.

Returns:
Previous token.

getPosition

public abstract int getPosition()
Returns the position of the tokenizer.

Returns:
The position of the tokenizer in the original string.

dispose

public abstract void dispose()
Disposes the tokenizer


isLeftBracket

public boolean isLeftBracket()
Checks if the last string is the left bracket.

Returns:
True is the string is left bracket.

isRightBracket

public boolean isRightBracket()
Checks if the last token is the right bracket.

Returns:
True is the last token is right bracket.