| java.lang.Object org.archive.util.PaddingStringBuffer
PaddingStringBuffer | final public class PaddingStringBuffer (Code) | | StringBuffer-like utility which can add spaces to reach a certain column. It
allows you to append
String , long and int s
to the buffer.
Note: This class counts from 1, not 0.
It uses a StringBuffer behind the scenes.
To write a string with multiple lines, it is advisible to use the
PaddingStringBuffer.newline() newline() function. Regular appending of strings with
newlines (\n) character should be safe though. Right appending of strings
with such characters is not safe.
author: Gordon Mohr |
PaddingStringBuffer | public PaddingStringBuffer()(Code) | | Create a new PaddingStringBuffer
|
append | public PaddingStringBuffer append(String string)(Code) | | append a string directly to the buffer
Parameters: string - the string to append This wrapped buffer w/ the passed string appended. |
append | public PaddingStringBuffer append(int i)(Code) | | append an int to the buffer.
Parameters: i - the int to append This wrapped buffer with i appended. |
append | public PaddingStringBuffer append(long lo)(Code) | | append a long to the buffer.
Parameters: lo - the long to append This wrapped buffer w/ appended long. |
padTo | public PaddingStringBuffer padTo(int col)(Code) | | Pad to a given column. If the buffer size is already greater than the
column, nothing is done.
Parameters: col - The buffer padded to i . |
raAppend | public PaddingStringBuffer raAppend(int col, String string)(Code) | | Append a string, right-aligned to the given columm. If the buffer
length is already greater than the column specified, it simply appends
the string
Parameters: col - the column to right-align to Parameters: string - the string, must not contain multiple lines. This wrapped buffer w/ append string, right-aligned to thegiven column. |
raAppend | public PaddingStringBuffer raAppend(int col, int i)(Code) | | Append an int right-aligned to the given column. If the
buffer length is already greater than the column specified, it simply
appends the int .
Parameters: col - the column to right-align to Parameters: i - the int to append This wrapped buffer w/ appended int, right-aligned to thegiven column. |
raAppend | public PaddingStringBuffer raAppend(int col, long lo)(Code) | | Append a long , right-aligned to the given column. If the
buffer length is already greater than the column specified, it simply
appends the long .
Parameters: col - the column to right-align to Parameters: lo - the long to append This wrapped buffer w/ appended long, right-aligned to thegiven column. |
reset | public void reset()(Code) | | reset the buffer back to empty
|
|
|