Package dap4.core.util
Class IndentWriter
- java.lang.Object
-
- java.io.Writer
-
- java.io.PrintWriter
-
- dap4.core.util.IndentWriter
-
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
public class IndentWriter extends PrintWriter
Extend PrintWriter to provide indent support
-
-
Field Summary
-
Fields inherited from class java.io.PrintWriter
out
-
-
Constructor Summary
Constructors Constructor Description IndentWriter(File file)
IndentWriter(OutputStream stream)
IndentWriter(Writer writer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
eol()
int
getIndent()
String
getMargin()
void
indent()
void
indent(int n)
Set depth += nvoid
margin()
void
marginPrint(String text)
void
marginPrintf(String fmt, Object... args)
void
marginPrintln()
void
marginPrintln(String text)
void
outdent()
void
outdent(int n)
void
pop()
void
println()
void
push()
void
setIndent(int n)
Set depth = n-
Methods inherited from class java.io.PrintWriter
append, append, append, checkError, clearError, 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, write, write, write
-
Methods inherited from class java.io.Writer
nullWriter
-
-
-
-
Constructor Detail
-
IndentWriter
public IndentWriter(File file) throws FileNotFoundException
- Throws:
FileNotFoundException
-
IndentWriter
public IndentWriter(Writer writer)
-
IndentWriter
public IndentWriter(OutputStream stream)
-
-
Method Detail
-
indent
public void indent()
-
outdent
public void outdent()
-
outdent
public void outdent(int n)
-
indent
public void indent(int n)
Set depth += n- Parameters:
n
- depth increment/decrement(if neg)
-
setIndent
public void setIndent(int n)
Set depth = n- Parameters:
n
- absolute depth
-
margin
public void margin()
-
getMargin
public String getMargin()
-
getIndent
public int getIndent()
-
push
public void push()
-
pop
public void pop()
-
eol
public void eol()
-
println
public void println()
- Overrides:
println
in classPrintWriter
-
marginPrintln
public void marginPrintln(String text)
-
marginPrintln
public void marginPrintln()
-
marginPrint
public void marginPrint(String text)
-
-