TokenStream.get

Gets the {@link Token} at the specified {@code index} in the stream. When the preconditions of this method are met, the return value is non-null.

<p>The preconditions for this method are the same as the preconditions of {@link IntStream#seek}. If the behavior of {@code seek(index)} is unspecified for the current state and given {@code index}, then the behavior of this method is also unspecified.</p>

<p>The symbol referred to by {@code index} differs from {@code seek()} only in the case of filtering streams where {@code index} lies before the end of the stream. Unlike {@code seek()}, this method does not adjust {@code index} to point to a non-ignored symbol.</p>

interface TokenStream
get
(
int index
)

Throws

- IllegalArgumentException if {code index} is less than 0<br> - UnsupportedOperationException if the stream does not support retrieving the token at the specified index

Meta