public interface Indentable
The 0
indent level is equivalent to no indents. For each
positive indent level, the number of space characters written will be
equivalent to the indent level times the width of a single indent level
(which defaults to 3 spaces).
So at the 0
indent level, no spaces are written. At the
1
indent level, 3 spaces (by default) are written. At the
2
indent level, 6 spaces (by default) are written and so on.
By changing the width and indent level, the exact indent results can be
completely controlled.
This class is not thread-safe.
Modifier and Type | Method and Description |
---|---|
void |
decrement()
Decrements the indent level by 1.
|
int |
getIndent()
Accesses the current indent level.
|
java.lang.String |
getPad()
Get the current pad.
|
int |
getWidth()
Accesses the number of spaces in a single indent level.
|
void |
increment()
Increments the indent level by 1.
|
void |
setIndent(int indent)
Sets the current indent level.
|
void |
setPad(int indent,
int width)
Sets both the indent level and the number of spaces in a single indent
level.
|
void |
setWidth(int width)
Sets the number of spaces in a single indent level.
|
int getIndent()
void setIndent(int indent)
indent
- New indent level.void increment()
void decrement()
int getWidth()
void setWidth(int width)
width
- New indent width.void setPad(int indent, int width)
indent
- New indent level.width
- New indent width.java.lang.String getPad()