Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

juju.reattore.util
Class PushbackArray  view PushbackArray download PushbackArray.java

java.lang.Object
  extended byjuju.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
           
 
Constructor Summary
PushbackArray()
           
 
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
 

Field Detail

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
Constructor Detail

PushbackArray

public PushbackArray()
Method Detail

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.