|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.Writer
java.io.PrintWriter
classUtils.pack.util.IndentedPrintWriter
public class IndentedPrintWriter
A PrintWriter which indents each line of text with a given character.
| Constructor Summary | |
|---|---|
IndentedPrintWriter(java.io.OutputStream out)
Create a new writer over the given stream, with the default indentation value and no autoflush. |
|
IndentedPrintWriter(java.io.OutputStream out,
boolean autoFlush)
Create a new writer over the given stream, with the default indentation value. |
|
IndentedPrintWriter(java.io.OutputStream out,
int indent)
Create a new writer over the given stream, with the given indentation value, and no autoflush. |
|
IndentedPrintWriter(java.io.OutputStream out,
int indent,
boolean autoFlush)
Create a new writer over the given stream, with the given indentation value. |
|
IndentedPrintWriter(java.io.Writer w)
Create a new writer over the given one, with the default indentation value, and no autoflush. |
|
IndentedPrintWriter(java.io.Writer w,
boolean autoFlush)
Create a new writer over the given one, with the defaukt indentation value. |
|
IndentedPrintWriter(java.io.Writer w,
int indent)
Create a new writer over the given one, with the given indentation value. |
|
IndentedPrintWriter(java.io.Writer w,
int indent,
boolean autoFlush)
Create a new writer over the given one, with the given indentation value. |
|
| Method Summary | |
|---|---|
void |
decIndentation()
Decrement the current indentation level. |
void |
decIndentation(int level)
Decrement the current indentation level of the given level. |
int |
getIndentation()
Return the current indentation level |
char |
getIndentationChar()
Return the charachter used to indent to the given character |
void |
incIndentation()
Increment the current indentation level. |
void |
incIndentation(int level)
Increment the current indentation level of the given level. |
void |
println()
Terminate the current line by writing the line separator string. |
void |
setIndentation(int indent)
Sets the current indentation level |
void |
setIndentationChar(char c)
Set the charachter used to indent to the given character |
void |
write(char[] buf,
int off,
int len)
Write a portion of character array, of given length from a given offset |
void |
write(int c)
Write a character |
void |
write(java.lang.String s,
int off,
int len)
Write a substring of a string, of given length from a given offset |
| Methods inherited from class java.io.PrintWriter |
|---|
append, append, append, checkError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, write, write |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IndentedPrintWriter(java.io.Writer w,
int indent)
setIndentationChar() to set it differently
if required.
w - the writer wrapped by this IndentationPrintWriterindent - the indentation level
public IndentedPrintWriter(java.io.OutputStream out,
int indent,
boolean autoFlush)
setIndentationChar() to set it differently
if required.
out - the stream wrapped by this IndentationPrintWriterindent - the indentation levelautoFlush - if true, the println() methods will flush the output buffer
public IndentedPrintWriter(java.io.OutputStream out,
int indent)
setIndentationChar() to set it differently
if required.
out - the stream wrapped by this IndentationPrintWriterindent - the indentation level
public IndentedPrintWriter(java.io.Writer w,
int indent,
boolean autoFlush)
setIndentationChar() to set it differently
if required.
w - the writer wrapped by this IndentationPrintWriterindent - the indentation levelautoFlush - if true, the println() methods will flush the output bufferpublic IndentedPrintWriter(java.io.Writer w)
setIndentationChar() to set it differently
if required.
w - the writer wrapped by this IndentationPrintWriter
public IndentedPrintWriter(java.io.OutputStream out,
boolean autoFlush)
setIndentationChar() to set it differently
if required.
out - the stream wrapped by this IndentationPrintWriterautoFlush - if true, the println() methods will flush the output bufferpublic IndentedPrintWriter(java.io.OutputStream out)
setIndentationChar() to set it differently
if required.
out - the stream wrapped by this IndentationPrintWriter
public IndentedPrintWriter(java.io.Writer w,
boolean autoFlush)
setIndentationChar() to set it differently
if required.
w - the writer wrapped by this IndentationPrintWriterautoFlush - if true, the println() methods will flush the output buffer| Method Detail |
|---|
public int getIndentation()
public void setIndentation(int indent)
indent - the desired indentation levelpublic void incIndentation(int level)
level - the indentation level to be incrementedpublic void decIndentation(int level)
level - the indentation level to be reducedpublic void incIndentation()
public void decIndentation()
public void setIndentationChar(char c)
c - the charachter to use for indentationpublic char getIndentationChar()
public void write(java.lang.String s,
int off,
int len)
write in class java.io.PrintWriterpublic void write(int c)
write in class java.io.PrintWriter
public void write(char[] buf,
int off,
int len)
write in class java.io.PrintWriterpublic void println()
line.separator, and is not necessarily a single newline
character ('\n').
println in class java.io.PrintWriter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||