jInfer

cz.cuni.mff.ksi.jinfer.basicxsd
Class Indentator

java.lang.Object
  extended by cz.cuni.mff.ksi.jinfer.basicxsd.Indentator

public class Indentator
extends Object

Helper class keeping an inserted text and an indentation level, providing methods to alter the level and to append another text. Formatted text is retrieved by toString() method.


Constructor Summary
Indentator(int spacesPerIndent)
          Constructs an instance with zero level of indentation.
 
Method Summary
 void append(String string)
          Appends specified text without indentation.
 void decreaseIndentation()
          decreases the indentation level per one.
 void increaseIndentation()
          Increases the indentation level per one.
 void indent(String string)
          Indent specified text and append it.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Indentator

public Indentator(int spacesPerIndent)
Constructs an instance with zero level of indentation.

Parameters:
spacesPerIndent - Number of space characters per one level of indentation.
Method Detail

indent

public void indent(String string)
Indent specified text and append it. No new line character is inserted, this is responsibility of a caller.

Parameters:
string - Text to indent and append.

append

public void append(String string)
Appends specified text without indentation. No new line character is inserted, this is responsibility of a caller.

Parameters:
string - Text to append.

toString

public String toString()
Overrides:
toString in class Object

increaseIndentation

public void increaseIndentation()
Increases the indentation level per one.


decreaseIndentation

public void decreaseIndentation()
decreases the indentation level per one.


jInfer

Generated on Fri Dec 9 00:01:25 CET 2011