Class BaseTokenStream
java.lang.Object
com.tangosol.coherence.dsltools.base.BaseTokenStream
Since BaseTokens can nest, BaseTokenStream creates for clients a utility
interface that allows streaming (atEnd(), next()) over a CompoundBaseToken.
- Author:
- djl 2009.03.14
-
Constructor Summary
ConstructorDescriptionBaseTokenStream
(CompoundBaseToken token) Constructor a new BaseTokenStream on the CompoundBaseToken. -
Method Summary
Modifier and TypeMethodDescriptionAnswer a current BaseToken base on the position of streaminggetLink()
Answer a BaseTokenStream that can become the target of streamingboolean
isEnd()
Answer a boolean indication as to whether the stream is at the endnext()
Answer the next token in the stream or null if at end.peek()
Answer the next token in the stream or null if at end.peek2()
Answer the next two tokens in the stream or null(s) if at end.void
Remember a BaseTokenStream that can be the target of streaming
-
Constructor Details
-
BaseTokenStream
Constructor a new BaseTokenStream on the CompoundBaseToken.- Parameters:
token
- the CompoundBaseToken to stream over
-
-
Method Details
-
isEnd
public boolean isEnd()Answer a boolean indication as to whether the stream is at the end- Returns:
- true if streaming is at an end otherwise false
-
getCurrentToken
Answer a current BaseToken base on the position of streaming- Returns:
- the BaseToken at the current stream position
-
next
Answer the next token in the stream or null if at end. Advance the stream position.- Returns:
- the next BaseToken in the stream
-
peek
Answer the next token in the stream or null if at end. Do not advance the stream position- Returns:
- the next BaseToken in the stream
-
peek2
Answer the next two tokens in the stream or null(s) if at end. Do not advance the stream position- Returns:
- the next BaseToken in the stream
-
setLink
Remember a BaseTokenStream that can be the target of streaming- Parameters:
ts
- the remembered token stream
-
getLink
Answer a BaseTokenStream that can become the target of streaming- Returns:
- the BaseTokenStream that can become the target of streaming
-