|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.holub.text.SimpleToken
public class SimpleToken
Matches a simple symbol that doesn't have to be on a "word"
boundary; punctuation, for example. SimpleToken
is very efficient, but does not recognize characters in
a case-insensitive way, as does WordToken and
RegexToken.
|
This code may be used freely by yourself with the following restrictions:
|
| Constructor Summary | |
|---|---|
SimpleToken(String pattern)
Create a token. |
|
| Method Summary | |
|---|---|
String |
lexeme()
Returns the input string that matched the token specification. |
boolean |
match(String input,
int offset)
Returns true if the sequence at the indicated offset from the beginning of the indicated input string matches the current token. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleToken(String pattern)
pattern - a string that defines a literal-match lexeme.| Method Detail |
|---|
public boolean match(String input,
int offset)
Token
match in interface Tokenpublic String lexeme()
Token
lexeme in interface Tokenpublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||