Modifier and Type | Class and Description |
---|---|
public abstract static class | IntegerFormatter.Traditional
A minor variation on |
Modifier and Type | Field and Description |
---|---|
private static final BigInteger | |
private static final BigInteger | |
private static final String |
Access | Constructor and Description |
---|---|
public | IntegerFormatter(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 | IntegerFormatter(InternalFormat.
parsed conversion specification specConstruct the formatter from a specification, allocating a buffer internally for the result. |
Modifier and Type | Method and Description |
---|---|
public IntegerFormatter | append(char
The character to append c)Overrides org. Implements java. Appendable .
|
public IntegerFormatter | 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 IntegerFormatter | 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 .
|
pack-priv void | appendNumber(String
to append number)Append a string (number) to |
public IntegerFormatter | Returns: this objectto convert value)Format a |
pack-priv void | |
pack-priv void | |
pack-priv void | |
pack-priv void | |
pack-priv void | format_x(BigInteger
to convert value, boolean if the hexadecimal should be upper case upper)Format the value as hexadecimal (into |
pack-priv final void | negativeSign(String
marker ("0x" or "0X" for hex, "0" for octal, base)null or "" for decimal.Append to |
pack-priv final void | positiveSign(String
marker "0x" or "0X" for hex, "0o" for octal, "0b" for binary, "" or
base)null for decimal.Append to |
private static final String | Returns: the binary representation of value, with "-" sign prepended if necessarythe value to generate a binary string from value)A more efficient algorithm for generating a binary representation of a byte array. |
private static final String | Returns: the hexadecimal representation of value, with "-" sign prepended if necessarythe value to generate a hexadecimal string from value)A more efficient algorithm for generating a hexadecimal representation of a byte array. |
private static final String | Returns: the octal representation of value, with "-" sign prepended if necessarythe value to generate an octal string from value)A more efficient algorithm for generating an octal representation of a byte array. |
LIMIT_BYTE | back to summary |
---|---|
private static final BigInteger LIMIT_BYTE |
LIMIT_UNICODE | back to summary |
---|---|
private static final BigInteger LIMIT_UNICODE |
LOOKUP | back to summary |
---|---|
private static final String LOOKUP |
IntegerFormatter | back to summary |
---|---|
public IntegerFormatter(StringBuilder result, InternalFormat. Construct the formatter from a client-supplied buffer, to which the result will be appended,
and a specification. Sets
|
IntegerFormatter | back to summary |
---|---|
public IntegerFormatter(InternalFormat. Construct the formatter from a specification, allocating a buffer internally for the result.
|
append | back to summary |
---|---|
public IntegerFormatter append(char c) Overrides org. Implements java. Doc from java. Appends the specified character to this
|
append | back to summary |
---|---|
public IntegerFormatter 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 IntegerFormatter 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))
|
appendNumber | back to summary |
---|---|
pack-priv void appendNumber(String number) Append a string (number) to
|
format | back to summary |
---|---|
public IntegerFormatter format(BigInteger value) throws FormatOverflow, FormatError Format a
|
format_b | back to summary |
---|---|
pack-priv void format_b(BigInteger value) Format the value as binary (into
|
format_c | back to summary |
---|---|
pack-priv void format_c(BigInteger value) throws FormatOverflow Format the value as a character (into
|
format_d | back to summary |
---|---|
pack-priv void format_d(BigInteger value) Format the value as decimal (into
|
format_o | back to summary |
---|---|
pack-priv void format_o(BigInteger value) Format the value as octal (into
|
format_x | back to summary |
---|---|
pack-priv void format_x(BigInteger value, boolean upper) Format the value as hexadecimal (into
|
negativeSign | back to summary |
---|---|
pack-priv final void negativeSign(String base) Append to
|
positiveSign | back to summary |
---|---|
pack-priv final void positiveSign(String base) Append to
|
toBinaryString | back to summary |
---|---|
private static final String toBinaryString(BigInteger value) A more efficient algorithm for generating a binary representation of a byte array.
|
toHexString | back to summary |
---|---|
private static final String toHexString(BigInteger value) A more efficient algorithm for generating a hexadecimal representation of a byte array.
|
toOctalString | back to summary |
---|---|
private static final String toOctalString(BigInteger value) A more efficient algorithm for generating an octal representation of a byte array.
|
IntegerFormatter
to handle "traditional" %-formatting. The
difference is in support for spec.precision
, the formatting octal in "alternate"
mode (0 and 0123, not 0o0 and 0o123), and in c-format (in the error logic).
Access | Constructor and Description |
---|---|
public | Traditional(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 | Traditional(InternalFormat.
parsed conversion specification specConstruct the formatter from a specification, allocating a buffer internally for the result. |
Modifier and Type | Method and Description |
---|---|
pack-priv void | appendNumber(String
to append number)Overrides org. result , but insert leading zeros first in order
that, on return, the whole-part length #lenWhole should be no less than the precision.
|
pack-priv void | appendOctalNumber(String
to append number)Append a string (number) to |
pack-priv void | format_c(BigInteger
to convert value)Overrides org. result ).
|
pack-priv void | format_o(BigInteger
to convert value)Overrides org. result ).
|
Traditional | back to summary |
---|---|
public Traditional(StringBuilder result, InternalFormat. Construct the formatter from a client-supplied buffer, to which the result will be
appended, and a specification. Sets
|
Traditional | back to summary |
---|---|
public Traditional(InternalFormat. Construct the formatter from a specification, allocating a buffer internally for the result.
|
appendNumber | back to summary |
---|---|
pack-priv void appendNumber(String number) Overrides org. Append a string (number) to |
appendOctalNumber | back to summary |
---|---|
pack-priv void appendOctalNumber(String number) Append a string (number) to
|
format_c | back to summary |
---|---|
pack-priv void format_c(BigInteger value) throws FormatOverflow Overrides org. Format the value as a character (into
|
format_o | back to summary |
---|---|
pack-priv void format_o(BigInteger value) Overrides org. Format the value as octal (into
|