IntStream.LA

Gets the value of the symbol at offset {@code i} from the current position. When {@code i==1}, this method returns the value of the current symbol in the stream (which is the next symbol to be consumed). When {@code i==-1}, this method returns the value of the previously read symbol in the stream. It is not valid to call this method with {@code i==0}, but the specific behavior is unspecified because this method is frequently called from performance-critical code.

<p>This method is guaranteed to succeed if any of the following are true:</p>

<ul> <li>{@code i>0}</li> <li>{@code i==-1} and {@link #index index()} returns a value greater than the value of {@code index()} after the stream was constructed and {@code LA(1)} was called in that order. Specifying the current {@code index()} relative to the index after the stream was created allows for filtering implementations that do not return every symbol from the underlying source. Specifying the call to {@code LA(1)} allows for lazily initialized streams.</li> <li>{@code LA(i)} refers to a symbol consumed within a marked region that has not yet been released.</li> </ul>

<p>If {@code i} represents a position at or beyond the end of the stream, this method returns {@link #EOF}.</p>

<p>The return value is unspecified if {@code i<0} and fewer than {@code -i} calls to {@link #consume consume()} have occurred from the beginning of the stream before calling this method.</p>

@throws UnsupportedOperationException if the stream does not support retrieving the value of the specified symbol

interface IntStream
int
LA
(
int i
)

Meta