str
and
unicode
formatting. In a limited way, it acts like a
StringBuilder to which text, formatted according to the format
specifier supplied at construction. These are ephemeral objects
that are not, on their own, thread safe.
Access | Constructor and Description |
---|---|
public | TextFormatter(StringBuilder
destination buffer result, InternalFormat.parsed conversion specification specConstruct the formatter from a client-supplied buffer, to which the result will be appended, and a specification. |
public | TextFormatter(InternalFormat.
parsed conversion specification specConstruct the formatter from a specification, allocating a buffer internally for the result. |
Modifier and Type | Method and Description |
---|---|
public TextFormatter | append(char
The character to append c)Overrides org. Implements java. Appendable .
|
public TextFormatter | |
public TextFormatter | append(CharSequence
The character sequence to append. If csq)csq is
null , then the four characters "null" are
appended to this Appendable.Overrides org. Implements java. Appendable .
|
public TextFormatter | append(CharSequence
The character sequence from which a subsequence will be
appended. If csq, int csq is null , then characters
will be appended as if csq contained the four
characters "null" .The index of the first character in the subsequence start, int The index of the character following the last character in the
subsequence end)Overrides org. Implements java. Appendable .
|
public TextFormatter | |
public TextFormatter | Returns: thisTextFormatter objectto format valueFormat the given |
public TextFormatter | pad()
Overrides org. result
from mark to the end) using the alignment, target width
and fill character defined in spec .
|
TextFormatter | back to summary |
---|---|
public TextFormatter(StringBuilder result, InternalFormat. Construct the formatter from a client-supplied buffer, to which
the result will be appended, and a specification. Sets
|
TextFormatter | back to summary |
---|---|
public TextFormatter(InternalFormat. Construct the formatter from a specification, allocating a buffer internally for the result.
|
append | back to summary |
---|---|
public TextFormatter append(char c) Overrides org. Implements java. Doc from java. Appends the specified character to this
|
append | back to summary |
---|---|
public TextFormatter append(int c) Overrides org.
|
append | back to summary |
---|---|
public TextFormatter append(CharSequence csq) Overrides org. Implements java. Doc from java. Appends the specified character sequence to this Depending on which class implements the character sequence
|
append | back to summary |
---|---|
public TextFormatter append(CharSequence csq, int start, int end) throws IndexOutOfBoundsException Overrides org. Implements java. Doc from java. Appends a subsequence of the specified character sequence to this
An invocation of this method of the form out.append(csq.subSequence(start, end))
|
format | back to summary |
---|---|
public TextFormatter format(String value) Format the given
|
format | back to summary |
---|---|
public TextFormatter format(PySequence. Format the given
|
pad | back to summary | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
public TextFormatter pad() Overrides org. Doc from org. Pad the result so far (defined as the contents of
When the padding method has decided that that it needs to add n
padding characters, it will affect
result[mark:] .) When this would not be
appropriate, it is up to the client to disallow this (which
complex does).
|