public class TokenParser extends Object
This class can be used to iterate through all codepoints of a token.
Modifier and Type | Field and Description |
---|---|
protected byte[] |
token
Token to be parsed.
|
Constructor and Description |
---|
TokenParser(byte[] token)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
consume(int ch)
Tries to consume the specified codepoint.
|
boolean |
more()
Checks if the parser will return more codepoints.
|
int |
next()
Returns the current codepoint and advances the cursor.
|
void |
reset()
Resets the cursor position.
|
IntList |
toList()
Returns a list with all codepoints.
|
String |
toString() |
public TokenParser(byte[] token)
token
- tokenpublic void reset()
public boolean more()
public int next()
-1
public boolean consume(int ch)
ch
- codepoint to be consumedpublic final IntList toList()
Copyright © 2005–2015 BaseX Team. All rights reserved.