jwo.utils.expression
Class Tokenizer
java.lang.Object
|
+--jwo.utils.expression.Tokenizer
- public class Tokenizer
- extends Object
A tokenizer that uses regular expressions to parse text.
Modified from original code described at
www.devx.com/premier/mgznarch/javapro/2001/05may01/ps0105/ps0105.asp.
- Version:
- 1.4, 15th February, 2001, modified 10th April, 2002.
- Author:
- Daniel Savarese, modified by Jo Wood.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_SEPARATOR
public static final String DEFAULT_SEPARATOR
- See Also:
- Constant Field Values
Tokenizer
public Tokenizer()
Tokenizer
public Tokenizer(String input)
setInput
public void setInput(String input)
setSeparator
public void setSeparator(String pattern)
throws org.apache.oro.text.regex.MalformedPatternException
org.apache.oro.text.regex.MalformedPatternException
addToken
public void addToken(String lexeme,
Object token)
throws org.apache.oro.text.regex.MalformedPatternException
org.apache.oro.text.regex.MalformedPatternException
reset
public void reset()
nextToken
public Token nextToken()
throws TokenNotFoundException
- Returns the next token in the input. If at end of input
returns null. If no token is found, throws an exception.
TokenNotFoundException