public class IndentManager extends Object
IndentManager(String)/
Everytime the more() method is called the current indentation
level is pushed onto a stack and the indentation level is increased by the
default amount. Everytime the less() method is called the stack
is popped and the current indentation level is set to the String popped from
the stack.
Example
IndentManager indent = new IndentManager();
System.out.println(indent + "<start>");
prettyPrintSomething(indent);
System.out.println(indent + "</start>");
...
void prettyPrintSomething(IndentManager indent)
{
indent.more();
System.out.println(indent + "<something/>");
indent.less();
}
| Modifier and Type | Field and Description |
|---|---|
protected String |
amount |
String |
increment |
protected Stack<String> |
stack |
| Constructor and Description |
|---|
IndentManager() |
IndentManager(String defaultIndent) |
| Modifier and Type | Method and Description |
|---|---|
void |
less() |
void |
more() |
void |
more(String size) |
void |
reset() |
String |
toString() |
Copyright © 2016 The American National Corpus. All rights reserved.