@Immutable protected class TokenStream.CaseSensitiveToken extends Object implements TokenStream.Token
TokenStream.Token that implements matching using case-sensitive logic.| Modifier and Type | Field and Description |
|---|---|
private int |
endIndex |
private Position |
position |
private int |
startIndex |
private int |
type |
| Constructor and Description |
|---|
CaseSensitiveToken(int startIndex,
int endIndex,
int type,
Position position) |
| Modifier and Type | Method and Description |
|---|---|
int |
endIndex()
Get the index in the raw stream past the last character in the token.
|
int |
length()
Get the length of the token, which is equivalent to
endIndex() - startIndex(). |
boolean |
matches(char expected)
Determine if the token matches the supplied character.
|
boolean |
matches(int expectedType)
Determine if the token matches the supplied type.
|
boolean |
matches(String expected)
Determine if the token matches the supplied string.
|
protected String |
matchString() |
Position |
position()
Get the position of this token, which includes the line number and column number of the first character in the token.
|
int |
startIndex()
Get the index in the raw stream for the first character in the token.
|
String |
toString() |
int |
type()
Get the type of the token.
|
String |
value()
Get the value of the token, in actual case.
|
TokenStream.Token |
withType(int typeMask)
Bitmask ORed with existing type value.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitmatchesprivate final int startIndex
private final int endIndex
private final int type
private final Position position
public CaseSensitiveToken(int startIndex,
int endIndex,
int type,
Position position)
public TokenStream.Token withType(int typeMask)
TokenStream.TokenwithType in interface TokenStream.TokentypeMask - the mask of typespublic final int type()
TokenStream.Tokentype in interface TokenStream.Tokenpublic final int startIndex()
TokenStream.TokenstartIndex in interface TokenStream.Tokenpublic final int endIndex()
TokenStream.TokenendIndex in interface TokenStream.Tokenpublic final int length()
TokenStream.TokenendIndex() - startIndex().length in interface TokenStream.Tokenpublic final boolean matches(char expected)
TokenStream.Tokenmatches in interface TokenStream.Tokenexpected - the expected character valuepublic boolean matches(String expected)
TokenStream.Tokenmatches in interface TokenStream.Tokenexpected - the expected valuepublic final boolean matches(int expectedType)
TokenStream.Tokenmatches in interface TokenStream.TokenexpectedType - the expected integer typepublic final String value()
TokenStream.Tokenvalue in interface TokenStream.Tokenpublic Position position()
TokenStream.Tokenposition in interface TokenStream.Tokenprotected String matchString()
Copyright © 2019 JBoss by Red Hat. All rights reserved.