java.lang.Object
juju.reattore.util.PushbackArray
- public class PushbackArray
- extends java.lang.Object
Simple one character pushback system that works across multiple
input arrays.
|
Field Summary |
static int |
EOF
Returned when all bytes have been read. |
private int |
last
|
private byte[] |
on
|
private int |
pos
|
|
Method Summary |
int |
get()
Returns the next byte in the pushback or input, or EOF if
everything has been read. |
void |
pushback(int b)
Returns the given byte back to the input. |
void |
seed(byte[] ab)
Seeds the push back system with a new array to read from. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EOF
public static final int EOF
- Returned when all bytes have been read.
- See Also:
- Constant Field Values
last
private int last
on
private byte[] on
pos
private int pos
PushbackArray
public PushbackArray()
seed
public void seed(byte[] ab)
- Seeds the push back system with a new array to read from.
Does not discard any existing push back.
get
public int get()
- Returns the next byte in the pushback or input, or EOF if
everything has been read.
pushback
public void pushback(int b)
- Returns the given byte back to the input. The next call to
get() will return this.