Overview  Package   Class  Tree  Index 

be.lassi.lanbox.tools
Class Token

java.lang.Object
  extended by be.lassi.lanbox.tools.Token

public class Token
extends java.lang.Object

A token generated by the tokenizer.


Constructor Summary
Token(int offset, java.lang.String string)
          Constructs a new token.
 
Method Summary
 char charAt(int index)
          Gets the character at given offset.
 int getInt()
          Gets the integer value of this token.
 int getOffset()
          Gets the token offset.
 java.lang.String getString()
          Gets the token string.
 boolean is(java.lang.String other)
          Indicates whether the token string is equal to given string.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Token

public Token(int offset,
             java.lang.String string)
Constructs a new token.

Parameters:
offset - the token offset
string - the token string
Method Detail

charAt

public char charAt(int index)
Gets the character at given offset.

Parameters:
index - the offset
Returns:
the character at given offset

getInt

public int getInt()
           throws ParseException
Gets the integer value of this token.

Returns:
the integer value
Throws:
ParseException - if this token does not contain an integer value

getOffset

public int getOffset()
Gets the token offset.

Returns:
the token offset

getString

public java.lang.String getString()
Gets the token string.

Returns:
the token string

is

public boolean is(java.lang.String other)
Indicates whether the token string is equal to given string.

Parameters:
other - the string to compare with
Returns:
true if both strings are equal

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

Overview  Package   Class  Tree  Index 
Lighting Assistant 1.2