|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectWriter
FilterWriter
IndentedLineWriter
public class IndentedLineWriter
A writer that put some spaces in front of every lines. The indentation is initially set
to 0 spaces. Users must invoke setIndentation(int)
in order to set a different value.
Field Summary |
---|
Fields inherited from class FilterWriter |
---|
out |
Fields inherited from class Writer |
---|
lock |
Constructor Summary | |
---|---|
IndentedLineWriter(Writer out)
Constructs a stream which will add spaces in front of each line. |
Method Summary | |
---|---|
protected void |
beginNewLine()
Invoked when a new line is begining. |
int |
getIdentation()
Returns the current indentation. |
void |
setIndentation(int width)
Sets the indentation to the specified value. |
void |
write(char[] buffer,
int offset,
int length)
Writes a portion of an array of characters. |
void |
write(int c)
Writes a single character. |
void |
write(String string,
int offset,
int length)
Writes a portion of a string. |
Methods inherited from class FilterWriter |
---|
close, flush |
Methods inherited from class Writer |
---|
append, append, append, write, write |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IndentedLineWriter(Writer out)
out
- The underlying stream to write to.Method Detail |
---|
public int getIdentation()
public void setIndentation(int width)
width
- The new indentation.protected void beginNewLine() throws IOException
setIndentation(int)
.
IOException
- If an I/O error occurspublic void write(int c) throws IOException
write
in class FilterWriter
IOException
- If an I/O error occurs.public void write(char[] buffer, int offset, int length) throws IOException
write
in class FilterWriter
buffer
- Buffer of characters to be written.offset
- Offset from which to start reading characters.length
- Number of characters to be written.
IOException
- If an I/O error occurs.public void write(String string, int offset, int length) throws IOException
write
in class FilterWriter
string
- String to be written.offset
- Offset from which to start reading characters.length
- Number of characters to be written.
IOException
- If an I/O error occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |