org.teatrove.tea.io
Class PushbackPositionReader

java.lang.Object
  extended by java.io.Reader
      extended by java.io.FilterReader
          extended by org.teatrove.trove.io.PositionReader
              extended by org.teatrove.tea.io.PositionReader
                  extended by org.teatrove.tea.io.PushbackPositionReader
All Implemented Interfaces:
Closeable, Readable
Direct Known Subclasses:
SourceReader

Deprecated. Moved to org.teatrove.trove.io package.

public class PushbackPositionReader
extends PositionReader

The PushbackPositionReader is a kind of pushback reader that tracks the postion in the stream of the next character to be read. The java.io.PushbackReader allows arbitrary characters to be pushed back. Since this Reader may need to keep track of how many characters were scanned from the underlying Reader to actually produce a character, the unread operation cannot accept any arbitrary character.

Author:
Brian S O'Neill
See Also:
PushbackReader

Field Summary
 
Fields inherited from class org.teatrove.trove.io.PositionReader
mPosition, mPosReader
 
Fields inherited from class java.io.FilterReader
in
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
PushbackPositionReader(Reader reader)
          Deprecated.  
PushbackPositionReader(Reader reader, int pushback)
          Deprecated.  
 
Method Summary
 int getStartPosition()
          Deprecated.  
 int peek()
          Deprecated.  
 int read()
          Deprecated.  
 void unread()
          Deprecated. Unread the last character read.
 void unread(int amount)
          Deprecated. Unread the last several characters read.
protected  void unreadHook(int c)
          Deprecated. A hook call from the unread method(s).
 
Methods inherited from class org.teatrove.trove.io.PositionReader
close, getNextPosition, read
 
Methods inherited from class java.io.FilterReader
mark, markSupported, ready, reset, skip
 
Methods inherited from class java.io.Reader
read, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PushbackPositionReader

public PushbackPositionReader(Reader reader)
Deprecated. 

PushbackPositionReader

public PushbackPositionReader(Reader reader,
                              int pushback)
Deprecated. 
Method Detail

getStartPosition

public int getStartPosition()
Deprecated. 
Returns:
the start position of the last read character.

read

public int read()
         throws IOException
Deprecated. 
Overrides:
read in class PositionReader
Throws:
IOException

peek

public int peek()
         throws IOException
Deprecated. 
Throws:
IOException

unread

public void unread(int amount)
            throws IOException
Deprecated. 
Unread the last several characters read.

Unlike PushbackReader, unread does not allow arbitrary characters to to be unread. Rather, it functions like an undo operation.

Parameters:
amount - Amount of characters to unread.
Throws:
IOException
See Also:
PushbackReader.unread(int)

unread

public void unread()
            throws IOException
Deprecated. 
Unread the last character read.

Unlike PushbackReader, unread does not allow arbitrary characters to to be unread. Rather, it functions like an undo operation.

Throws:
IOException
See Also:
PushbackReader.unread(int)

unreadHook

protected void unreadHook(int c)
Deprecated. 
A hook call from the unread method(s). Every unread character is passed to this method.



Copyright © 1997-2012 TeaTrove.org. All Rights Reserved.