edu.rice.cs.plt.io
Class WrappedDirectReader

java.lang.Object
  extended by java.io.Reader
      extended by edu.rice.cs.plt.io.DirectReader
          extended by edu.rice.cs.plt.io.WrappedDirectReader
All Implemented Interfaces:
Composite, java.io.Closeable, java.lang.Readable

public class WrappedDirectReader
extends DirectReader
implements Composite

An implementation of DirectReader that inherits that class's default implementations and delegates all other operations to the wrapped Reader.


Field Summary
 
Fields inherited from class edu.rice.cs.plt.io.DirectReader
DEFAULT_BUFFER_SIZE
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
WrappedDirectReader(java.io.Reader reader)
           
 
Method Summary
 void close()
           
 int compositeHeight()
          Get the maximum path length from this node to a leaf.
 int compositeSize()
          Get the number of nodes in the tree rooted at this node.
static DirectReader makeDirect(java.io.Reader reader)
          If the input is a DirectReader, cast it; otherwise, create a WrappedDirectReader.
 void mark(int readAheadLimit)
           
 boolean markSupported()
           
 int read()
           
 int read(char[] cbuf)
           
 int read(char[] cbuf, int offset, int length)
           
 boolean ready()
           
 void reset()
           
 long skip(long n)
           
 
Methods inherited from class edu.rice.cs.plt.io.DirectReader
read, read, read, readAll, readAll, readAll
 
Methods inherited from class java.io.Reader
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WrappedDirectReader

public WrappedDirectReader(java.io.Reader reader)
Method Detail

compositeHeight

public int compositeHeight()
Description copied from interface: Composite
Get the maximum path length from this node to a leaf.

Specified by:
compositeHeight in interface Composite

compositeSize

public int compositeSize()
Description copied from interface: Composite
Get the number of nodes in the tree rooted at this node. Always 1 or greater.

Specified by:
compositeSize in interface Composite

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.io.Reader
Throws:
java.io.IOException

mark

public void mark(int readAheadLimit)
          throws java.io.IOException
Overrides:
mark in class java.io.Reader
Throws:
java.io.IOException

markSupported

public boolean markSupported()
Overrides:
markSupported in class java.io.Reader

read

public int read()
         throws java.io.IOException
Overrides:
read in class java.io.Reader
Throws:
java.io.IOException

read

public int read(char[] cbuf)
         throws java.io.IOException
Overrides:
read in class java.io.Reader
Throws:
java.io.IOException

read

public int read(char[] cbuf,
                int offset,
                int length)
         throws java.io.IOException
Specified by:
read in class java.io.Reader
Throws:
java.io.IOException

ready

public boolean ready()
              throws java.io.IOException
Overrides:
ready in class java.io.Reader
Throws:
java.io.IOException

reset

public void reset()
           throws java.io.IOException
Overrides:
reset in class java.io.Reader
Throws:
java.io.IOException

skip

public long skip(long n)
          throws java.io.IOException
Overrides:
skip in class java.io.Reader
Throws:
java.io.IOException

makeDirect

public static DirectReader makeDirect(java.io.Reader reader)
If the input is a DirectReader, cast it; otherwise, create a WrappedDirectReader.