|
ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavafe.util.CorrelatedReader
javafe.util.BufferedCorrelatedReader
javafe.util.SubCorrelatedReader
A reader (aka input stream) that provides an associated location with each character read.
See javafe.util.Location for the interpretation of these locations.
We also provide a method to create a new
CorrelatedReader
for the text between the marked
position and the current point in the stream. Marking is also
allowed on the new CorrelatedReader
object.
Location
Field Summary | |
private GenericFile |
file
|
Fields inherited from class javafe.util.BufferedCorrelatedReader |
beforeBufLoc, buf, curNdx, endBufNdx, lastCharNdx, markNdx, maxLoc, minLoc, oddSlashLoc, STARTFREELOC |
Fields inherited from class javafe.util.CorrelatedReader |
marked |
Constructor Summary | |
SubCorrelatedReader(GenericFile file,
byte[] buf,
int beforeBufLoc)
Creates a sub-reader. |
Method Summary | |
GenericFile |
getFile()
Returns the file underlying this correlated reader. |
int |
read()
See spec in the abstract CorrelatedReader class. |
protected boolean |
refillBuf()
Refills the buffer. |
Methods inherited from class javafe.util.BufferedCorrelatedReader |
clearMark, close, createReaderFromMark, getBeforeMarkLocation, getBufferFromMark, getLocation, mark, peek, readRaw, reset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private GenericFile file
Constructor Detail |
public SubCorrelatedReader(GenericFile file, byte[] buf, int beforeBufLoc)
This method captures the given buf
, that is,
callers should no longer use buf
after passing it
in to this constructor.
Method Detail |
public GenericFile getFile()
getFile
in class CorrelatedReader
public int read() throws java.io.IOException
CorrelatedReader
class.
read
in class CorrelatedReader
java.io.IOException
protected boolean refillBuf() throws java.io.IOException
BufferedCorrelatedReader
In doing so, may reallocate the buffer.
Returns true iff not end-of-file, and at least one character was read from the file. Throws an IOException if no characters could be read from the stream.
Requires we are open.
refillBuf
in class BufferedCorrelatedReader
java.io.IOException
|
ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |