FastQueue superclass to
keep all elements until no more markers; then can reset to avoid growing a
huge buffer.
| Modifier and Type | Field and Description |
|---|---|
| protected int | currentElementIndex
Absolute token index. |
| public T | eof
Track object returned by nextElement upon end of stream; Return it later when they ask for LT passed end of input. |
| protected int | lastMarker
Track the last mark() call result value for use in rewind(). |
| protected int | markDepth
tracks how deep mark() calls are nested |
| protected T | prevElement
This is the |
| public static final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public int | |
| public abstract boolean | |
| protected T | |
| public T | |
| public int | |
| public abstract T | |
| public void | |
| public T | remove()
Overrides org. FastQueue#remove(); it's the same, just checks for backtracking.
|
| public void | |
| public void | |
| public void | |
| public void | |
| public int | size()
Overrides org. |
| protected void |
| currentElementIndex | back to summary |
|---|---|
| protected int currentElementIndex Absolute token index. It's the index of the symbol about to be
read via | |
| eof | back to summary |
|---|---|
| public T eof Track object returned by nextElement upon end of stream; Return it later when they ask for LT passed end of input. | |
| lastMarker | back to summary |
|---|---|
| protected int lastMarker Track the last mark() call result value for use in rewind(). | |
| markDepth | back to summary |
|---|---|
| protected int markDepth tracks how deep mark() calls are nested | |
| prevElement | back to summary |
|---|---|
| protected T prevElement This is the | |
| UNINITIALIZED_EOF_ELEMENT_INDEX | back to summary |
|---|---|
| public static final int UNINITIALIZED_EOF_ELEMENT_INDEX | |
| LookaheadStream | back to summary |
|---|---|
| public LookaheadStream() | |
| consume | back to summary |
|---|---|
| public void consume() Make sure we have at least one element to remove, even if EOF | |
| fill | back to summary |
|---|---|
| public void fill(int n) add n elements to buffer | |
| index | back to summary |
|---|---|
| public int index() | |
| isEOF | back to summary |
|---|---|
| public abstract boolean isEOF(T o) | |
| LB | back to summary |
|---|---|
| protected T LB(int k) | |
| LT | back to summary |
|---|---|
| public T LT(int k) | |
| mark | back to summary |
|---|---|
| public int mark() | |
| nextElement | back to summary |
|---|---|
| public abstract T nextElement() Implement nextElement to supply a stream of elements to this lookahead buffer. Return EOF upon end of the stream we're pulling from.
| |
| release | back to summary |
|---|---|
| public void release(int marker) | |
| remove | back to summary |
|---|---|
| public T remove() Overrides org. Get and remove first element in queue; override
| |
| reset | back to summary |
|---|---|
| public void reset() Overrides org.
| |
| rewind | back to summary |
|---|---|
| public void rewind(int marker) | |
| rewind | back to summary |
|---|---|
| public void rewind() | |
| seek | back to summary |
|---|---|
| public void seek(int index) Seek to a 0-indexed absolute token index. Normally used to seek backwards in the buffer. Does not force loading of nodes.
To preserve backward compatibility, this method allows seeking past the
end of the currently buffered data. In this case, the input pointer will
be moved but the data will only actually be loaded upon the next call to
| |
| size | back to summary |
|---|---|
| public int size() Overrides org. Size of entire stream is unknown; we only know buffer size from FastQueue.
| |
| syncAhead | back to summary |
|---|---|
| protected void syncAhead(int need) Make sure we have 'need' elements from current position p. Last valid p index is data.size()-1. p+need-1 is the data index 'need' elements ahead. If we need 1 element, (p+1-1)==p must be < data.size(). | |