public class

TextBuilder

extends Object
implements Appendable
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.format.TextBuilder
Known Direct Subclasses

Class Overview

A text buffer builder supporting indentation. Can be seen as an alternative to StringBuilder to easily create structured documents.

This class may be sub-classed.

Summary

Public Constructors
TextBuilder()
Create a builder with a default indentation size of 4 characters and an initial capacity of 16 characters.
TextBuilder(int indentationSize)
Create a builder with an initial capacity of 16 characters.
TextBuilder(int indentationSize, int initialCapacity)
Create a builder.
Public Methods
TextBuilder append(long v)
TextBuilder append(char v)
TextBuilder append(byte v)
TextBuilder append(short v)
TextBuilder append(Object o)
TextBuilder append(double v)
TextBuilder append(float v)
TextBuilder append(int v)
TextBuilder append(String format, Object... args)
TextBuilder append(CharSequence csq, int start, int end)
TextBuilder append(CharSequence csq)
TextBuilder appendLine(boolean noIndent)
TextBuilder appendLine(String format, Object... args)
TextBuilder appendLine()
void clear()
TextBuilder eol()
TextBuilder indent()
TextBuilder indent(boolean followedByEol)
int length()
void removeChar(int pos)
void removeChars(int start, int end)
void removeLastChar()
void removeLastLine()
TextBuilder space()
String toString()
TextBuilder unindent()
void updateIndentation(boolean doIndent)
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.lang.Appendable

Public Constructors

public TextBuilder ()

Create a builder with a default indentation size of 4 characters and an initial capacity of 16 characters.

public TextBuilder (int indentationSize)

Create a builder with an initial capacity of 16 characters.

public TextBuilder (int indentationSize, int initialCapacity)

Create a builder.

Public Methods

public TextBuilder append (long v)

public TextBuilder append (char v)

public TextBuilder append (byte v)

public TextBuilder append (short v)

public TextBuilder append (Object o)

public TextBuilder append (double v)

public TextBuilder append (float v)

public TextBuilder append (int v)

public TextBuilder append (String format, Object... args)

public TextBuilder append (CharSequence csq, int start, int end)

public TextBuilder append (CharSequence csq)

public TextBuilder appendLine (boolean noIndent)

public TextBuilder appendLine (String format, Object... args)

public TextBuilder appendLine ()

public void clear ()

public TextBuilder eol ()

public TextBuilder indent ()

public TextBuilder indent (boolean followedByEol)

public int length ()

public void removeChar (int pos)

public void removeChars (int start, int end)

public void removeLastChar ()

public void removeLastLine ()

public TextBuilder space ()

public String toString ()

public TextBuilder unindent ()

public void updateIndentation (boolean doIndent)