edu.rice.cs.plt.io
Class WrappedDirectWriter
java.lang.Object
java.io.Writer
edu.rice.cs.plt.io.DirectWriter
edu.rice.cs.plt.io.WrappedDirectWriter
- All Implemented Interfaces:
- Composite, java.io.Closeable, java.io.Flushable, java.lang.Appendable
public class WrappedDirectWriter
- extends DirectWriter
- implements Composite
An implementation of DirectWriter that inherits that class's default implementations
and delegates all other operations to the wrapped Writer.
| Fields inherited from class java.io.Writer |
lock |
|
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. |
void |
flush()
|
static DirectWriter |
makeDirect(java.io.Writer writer)
If the input is a DirectWriter, cast it; otherwise, create a
WrappedDirectWriter. |
void |
write(char[] cbuf)
|
void |
write(char[] cbuf,
int offset,
int length)
|
void |
write(int c)
|
void |
write(java.lang.String s)
|
void |
write(java.lang.String s,
int offset,
int length)
|
| Methods inherited from class java.io.Writer |
append, append, append |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WrappedDirectWriter
public WrappedDirectWriter(java.io.Writer writer)
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.Writer
- Throws:
java.io.IOException
flush
public void flush()
throws java.io.IOException
- Specified by:
flush in interface java.io.Flushable- Specified by:
flush in class java.io.Writer
- Throws:
java.io.IOException
write
public void write(int c)
throws java.io.IOException
- Overrides:
write in class java.io.Writer
- Throws:
java.io.IOException
write
public void write(char[] cbuf)
throws java.io.IOException
- Overrides:
write in class java.io.Writer
- Throws:
java.io.IOException
write
public void write(char[] cbuf,
int offset,
int length)
throws java.io.IOException
- Specified by:
write in class java.io.Writer
- Throws:
java.io.IOException
write
public void write(java.lang.String s)
throws java.io.IOException
- Overrides:
write in class java.io.Writer
- Throws:
java.io.IOException
write
public void write(java.lang.String s,
int offset,
int length)
throws java.io.IOException
- Overrides:
write in class java.io.Writer
- Throws:
java.io.IOException
makeDirect
public static DirectWriter makeDirect(java.io.Writer writer)
- If the input is a
DirectWriter, cast it; otherwise, create a
WrappedDirectWriter.