public interface WrappedToken extends TrackingToken
Modifier and Type | Method and Description |
---|---|
TrackingToken |
advancedTo(TrackingToken newToken)
Advance this token to the given
newToken . |
TrackingToken |
lowerBound()
Returns the token representing the current position in the stream.
|
<R extends TrackingToken> |
unwrap(Class<R> tokenType)
Retrieve a token of given
tokenType if it is wrapped by this token. |
static <R extends TrackingToken> |
unwrap(TrackingToken token,
Class<R> tokenType)
Unwrap the given
token until a token of given tokenType is exposed. |
static TrackingToken |
unwrapLowerBound(TrackingToken token)
Extracts a raw token describing the current processing position of the given
token . |
static TrackingToken |
unwrapUpperBound(TrackingToken token)
Extracts a raw token describing the current processing position of the given
token . |
TrackingToken |
upperBound()
Returns the token representing the furthest position in the stream described by this token.
|
covers, lowerBound, position, upperBound
static TrackingToken unwrapLowerBound(TrackingToken token)
token
. If the given token
is a wrapped token, it will be unwrapped until the raw token (as received from the event stream) is reached.
The returned token represents the minimal position described by the given token (which may express a range)
token
- The token to unwrapstatic TrackingToken unwrapUpperBound(TrackingToken token)
token
. If the given token
is a wrapped token, it will be unwrapped until the raw token (as received from the event stream) is reached.
The returned token represents the furthest position described by the given token (which may express a range)
token
- The token to unwrapstatic <R extends TrackingToken> Optional<R> unwrap(TrackingToken token, Class<R> tokenType)
token
until a token of given tokenType
is exposed. Returns an empty optional
if the given token
is not a WrappedToken instance, or if it does not wrap a token of expected
tokenType
.R
- The generic type of the token to revealtoken
- The token to unwraptokenType
- The type of token to revealTrackingToken advancedTo(TrackingToken newToken)
newToken
.newToken
- The token representing the position to advance toTrackingToken lowerBound()
TrackingToken upperBound()
<R extends TrackingToken> Optional<R> unwrap(Class<R> tokenType)
tokenType
if it is wrapped by this token.R
- The generic type of the token to unwrap totokenType
- The type of token to unwrap toCopyright © 2010–2020. All rights reserved.