|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Writer
java.io.PrintWriter
org.progeeks.util.IndentPrintWriter
public class IndentPrintWriter
PrintWriter implementation that keeps track of an indent state.
Field Summary |
---|
Fields inherited from class java.io.PrintWriter |
---|
out |
Fields inherited from class java.io.Writer |
---|
lock |
Constructor Summary | |
---|---|
IndentPrintWriter(java.io.Writer out)
|
Method Summary | |
---|---|
void |
endLine()
Ends the current line and sets up for a new indent. |
java.lang.String |
getDefaultIndent()
Returns the default indent string used by the no-arg pushIndent() method. |
boolean |
isNewLine()
Returns true if this is a new line. |
void |
popIndent()
Pops an indent off of the indent stack. |
void |
println()
Resets the new line state and outputs a line separator. |
void |
pushIndent()
Pushes another indent onto the indent stack. |
void |
pushIndent(java.lang.String indent)
Pushes a custom indent onto the indent stack. |
void |
setDefaultIndent(java.lang.String s)
Sets the default indent string used by the no-arg pushIndent() method. |
void |
setOverrideIndent(boolean override)
Set to true to override the current indent. |
void |
write(char[] buff,
int off,
int len)
Overridden to set the new line state to false and to write the indent level if newLine is true. |
void |
write(int c)
Overridden to set the new line state to false and to write the indent level if newLine is true. |
void |
write(java.lang.String s,
int off,
int len)
Overridden to set the new line state to false and to write the indent level if newLine is true. |
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, setError, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IndentPrintWriter(java.io.Writer out)
Method Detail |
---|
public void setDefaultIndent(java.lang.String s)
public java.lang.String getDefaultIndent()
public void pushIndent()
public void pushIndent(java.lang.String indent)
public void popIndent()
public void setOverrideIndent(boolean override)
public void write(int c)
write
in class java.io.PrintWriter
public void write(char[] buff, int off, int len)
write
in class java.io.PrintWriter
public void write(java.lang.String s, int off, int len)
write
in class java.io.PrintWriter
public void println()
println
in class java.io.PrintWriter
public void endLine()
public boolean isNewLine()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |