public class Token extends Object
Tokens are immutable.
Modifier and Type | Class and Description |
---|---|
static class |
Token.TokenType
Tokenizers may product multiple kinds of tokens, depending on the application
to which they're being put.
|
Modifier and Type | Field and Description |
---|---|
int |
end |
int |
start |
String |
text |
Token.TokenType |
type |
Constructor and Description |
---|
Token(String text,
int start,
int end)
Constructs a token.
|
Token(String text,
int start,
int end,
Token.TokenType type)
Constructs a token.
|
public final String text
public final int start
public final int end
public final Token.TokenType type
public Token(String text, int start, int end)
text
- should be equivalent to the substring of the original tokenized
text for the given character offsets start and endstart
- the starting offset of the tokenend
- the ending offset of the token (exclusive or inclusive?)public Token(String text, int start, int end, Token.TokenType type)
text
- should be equivalent to the substring of the original tokenized
text for the given character offsets start and endstart
- the starting offset of the tokenend
- the ending offset of the token (exclusive or inclusive?)type
- the type of the tokenCopyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.