aa.util
Class Lexer

java.lang.Object
  extended byaa.util.Lexer

public class Lexer
extends java.lang.Object

This class performs tokenizing a input string to separate string tokens.

History:

Version:
$Date: 2008/01/01 00:24:06 $ $Revision: 1.1 $
Author:
Myeong-Wuk Jang

Field Summary
private static int m_iMAX_TOKENS
          Maximum number of tokens.
 
Constructor Summary
Lexer()
           
 
Method Summary
private static java.lang.String[] compactString(java.lang.String[] p_straToken, int p_iTokens)
          Returns an array of tokens that does not have null elements.
static java.lang.String[] getTokens(java.lang.String p_strInput)
          Extracts string tokens from the given input string, and returns them.
private static java.lang.String removeBlank(java.lang.String p_strInput)
          Removes blanks in the front part of the specified string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_iMAX_TOKENS

private static final int m_iMAX_TOKENS
Maximum number of tokens.

See Also:
Constant Field Values
Constructor Detail

Lexer

public Lexer()
Method Detail

removeBlank

private static java.lang.String removeBlank(java.lang.String p_strInput)
Removes blanks in the front part of the specified string.

Parameters:
p_strInput - an input string
Returns:
the string whose front blanks are removed if the input string has valid characters;
null otherwise.

compactString

private static java.lang.String[] compactString(java.lang.String[] p_straToken,
                                                int p_iTokens)
Returns an array of tokens that does not have null elements.

Parameters:
p_straToken - an array of string tokens which has null elements. p_iTokens the number of no-null string tokens in the p_straToken array.
Returns:
an array of tokens that does not have null elements if the input array has valid tokens;
null otherwise.

getTokens

public static java.lang.String[] getTokens(java.lang.String p_strInput)
Extracts string tokens from the given input string, and returns them.

Parameters:
p_strInput - the input string.
Returns:
an array of string tokens if the input has valid tokens;
null otherwise.