|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Writer
com.sun.javatest.util.WrapWriter
public class WrapWriter
A writer that will automatically word wrap lines to fit within left and right margins.
Field Summary |
---|
Fields inherited from class java.io.Writer |
---|
lock |
Constructor Summary | |
---|---|
WrapWriter(java.io.OutputStream out)
Create a WrapWriter object that will write to a given stream. |
|
WrapWriter(java.io.Writer out)
Create a WrapWriter object that will write to a given stream. |
Method Summary | |
---|---|
void |
close()
|
void |
flush()
|
int |
getCharsOnLineSoFar()
Get the number of characters that have been written so far on the current line. |
int |
getLeftMargin()
Get the position for the left margin for the text stream. |
int |
getRightMargin()
Get the position for the right margin for the text stream. |
void |
setLeftMargin(int m)
Set the position for the left margin for the text stream. |
void |
setRightMargin(int m)
Set the position for the right margin for the text stream. |
void |
write(char c)
Write a character to the stream. |
void |
write(char[] cbuf,
int off,
int len)
|
Methods inherited from class java.io.Writer |
---|
append, append, append, write, write, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WrapWriter(java.io.OutputStream out)
out
- the stream to which the WrapWriter will writepublic WrapWriter(java.io.Writer out)
out
- the stream to which the WrapWriter will writeMethod Detail |
---|
public void setLeftMargin(int m)
m
- the position for the left margin
java.lang.IllegalArgumentException
- if the value is negative or
greater than the current value of the right margingetLeftMargin()
public int getLeftMargin()
setLeftMargin(int)
public void setRightMargin(int m)
m
- the position for the right margin
java.lang.IllegalArgumentException
- if the value is
less than the current value of the left margingetRightMargin()
public int getRightMargin()
setRightMargin(int)
public int getCharsOnLineSoFar()
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.Writer
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.Writer
java.io.IOException
public void write(char[] cbuf, int off, int len) throws java.io.IOException
write
in class java.io.Writer
java.io.IOException
public void write(char c) throws java.io.IOException
c
- the character to be written
java.io.IOException
- if there is a problem writing to the underlying stream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |