public static enum Scanner.TokenType extends Enum<Scanner.TokenType>
| Enum Constant and Description |
|---|
BOOLEAN_LITERAL
The token represents a boolean literal; its
Scanner.Token.value is either 'true' or 'false'. |
C_PLUS_PLUS_STYLE_COMMENT
The token represents a C++-style comment like "
// This is a C++-style comment.". |
C_STYLE_COMMENT
The token represents a C-style comment, like "
/* This is a C-style comment. */", which may
span multiple lines. |
CHARACTER_LITERAL
The token represents a character literal; its
Scanner.Token.value is the text of the character literal
exactly as it appears in the source code (including the single quotes around it). |
END_OF_INPUT
Indication of the 'end-of-input' condition.
|
FLOATING_POINT_LITERAL
The token represents a floating-point literal; its
Scanner.Token.value is the text of the floating-point
literal exactly as it appears in the source code (e.g. "1.23", "1.23F", "1.23D", "1 |
IDENTIFIER
The token represents a Java identifier.
|
INTEGER_LITERAL
The token represents an integer literal; its
Scanner.Token.value is the text of the integer literal exactly
as it appears in the source code (e.g. "0", "123", "123L", "03ff", "0xffff", "0b10101010"). |
KEYWORD
The token represents a Java keyword.
|
NULL_LITERAL
The token represents the
null literal; its Scanner.Token.value is 'null'. |
OPERATOR
The token represents an operator; its
Scanner.Token.value is exactly the particular operator (e.g. |
STRING_LITERAL
The token represents a string literal; its
Scanner.Token.value is the text of the string literal exactly as
it appears in the source code (including the double quotes around it). |
WHITE_SPACE
The token represents "white space"; i.e. a non-empty sequence of whitespace characters.
|
| Modifier and Type | Method and Description |
|---|---|
static Scanner.TokenType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Scanner.TokenType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Scanner.TokenType END_OF_INPUT
public static final Scanner.TokenType IDENTIFIER
public static final Scanner.TokenType KEYWORD
"true", "false" and "null" are not
Java keywords, but BOOLEAN_LITERALs and NULL_LITERALs.)public static final Scanner.TokenType INTEGER_LITERAL
Scanner.Token.value is the text of the integer literal exactly
as it appears in the source code (e.g. "0", "123", "123L", "03ff", "0xffff", "0b10101010").public static final Scanner.TokenType FLOATING_POINT_LITERAL
Scanner.Token.value is the text of the floating-point
literal exactly as it appears in the source code (e.g. "1.23", "1.23F", "1.23D", "1.", ".1", "1E13").public static final Scanner.TokenType BOOLEAN_LITERAL
Scanner.Token.value is either 'true' or 'false'.public static final Scanner.TokenType CHARACTER_LITERAL
Scanner.Token.value is the text of the character literal
exactly as it appears in the source code (including the single quotes around it).public static final Scanner.TokenType STRING_LITERAL
Scanner.Token.value is the text of the string literal exactly as
it appears in the source code (including the double quotes around it).public static final Scanner.TokenType NULL_LITERAL
null literal; its Scanner.Token.value is 'null'.public static final Scanner.TokenType OPERATOR
Scanner.Token.value is exactly the particular operator (e.g.
"<<<=").public static final Scanner.TokenType WHITE_SPACE
public static final Scanner.TokenType C_PLUS_PLUS_STYLE_COMMENT
// This is a C++-style comment.". Notice that the
line terminator is not part of the comment; hence, this token is always followed by a WHITE_SPACE token (or by END_OF_INPUT).public static final Scanner.TokenType C_STYLE_COMMENT
/* This is a C-style comment. */", which may
span multiple lines. In the latter case, the enclosed line terminators appear exactly as in the input
stream.public static Scanner.TokenType[] values()
for (Scanner.TokenType c : Scanner.TokenType.values()) System.out.println(c);
public static Scanner.TokenType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is null