| Modifier and Type | Class and Description |
|---|---|
| public static class | IntegerFormatter.
A minor variation on |
| Modifier and Type | Field and Description |
|---|---|
| public static final InternalFormat. | BIN
Format specification used by bin(). |
| public static final InternalFormat. | HEX
Format specification used by hex(). |
| private static final BigInteger | |
| private static final BigInteger | |
| private static final String | |
| public static final InternalFormat. | OCT
Format specification used by oct(). |
| 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. Appends the specified character to this |
| 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. Appends the specified character sequence to this |
| 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. Appends a subsequence of the specified character sequence to this
|
| pack-priv void | appendNumber(String
to append number)Append a string (number) to |
| public static PyString | |
| public IntegerFormatter | Returns: this objectto convert value)Format a |
| public IntegerFormatter | Returns: this objectto convert value)Format an integer according to the specification represented by this
|
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| 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 void | |
| public static PyString | Returns: PyString converted resultto convert number, InternalFormat.Convert the object according to the conventions of Python built-in |
| 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. |
| BIN | back to summary |
|---|---|
| public static final InternalFormat. Format specification used by bin(). | |
| HEX | back to summary |
|---|---|
| public static final InternalFormat. Format specification used by hex(). | |
| 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 | |
| OCT | back to summary |
|---|---|
| public static final InternalFormat. Format specification used by oct(). | |
| 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
The contents of this
| |
| 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))
The contents of this
A reference to this
| |
| appendNumber | back to summary |
|---|---|
| pack-priv void appendNumber(String number) Append a string (number) to
| |
| bin | back to summary |
|---|---|
| public static PyString bin(PyObject number) Convert the object to binary according to the conventions of Python built-in
| |
| format | back to summary |
|---|---|
| public IntegerFormatter format(BigInteger value) Format a
| |
| format | back to summary |
|---|---|
| public IntegerFormatter format(int value) Format an integer according to the specification represented by this
| |
| format_b | back to summary |
|---|---|
| pack-priv void format_b(BigInteger value) Format the value as binary (into
| |
| format_b | back to summary |
|---|---|
| pack-priv void format_b(int value) Format the value as binary (into
| |
| format_c | back to summary |
|---|---|
| pack-priv void format_c(BigInteger value) Format the value as a character (into
| |
| format_c | back to summary |
|---|---|
| pack-priv void format_c(int value) 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_d | back to summary |
|---|---|
| pack-priv void format_d(int 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_o | back to summary |
|---|---|
| pack-priv void format_o(int 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
| |
| format_x | back to summary |
|---|---|
| pack-priv void format_x(int value, boolean upper) Format the value as hexadecimal (into
| |
| formatNumber | back to summary |
|---|---|
| public static PyString formatNumber(PyObject number, InternalFormat. Convert the object according to the conventions of Python built-in | |
| 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. Append a string (number) to |
| pack-priv void | appendOctalNumber(String
to append number)Append a string (number) to |
| pack-priv void | format_c(BigInteger
to convert value)Overrides org. Format the value as a character (into |
| pack-priv void | format_c(int
to convert value)Overrides org. Format the value as a character (into |
| pack-priv void | format_o(BigInteger
to convert value)Overrides org. Format the value as octal (into |
| pack-priv void | format_o(int
to convert value)Overrides org. Format the value as octal (into |
| 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) Overrides org. Format the value as a character (into
| |
| format_c | back to summary |
|---|---|
| pack-priv void format_c(int value) 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
| |
| format_o | back to summary |
|---|---|
| pack-priv void format_o(int value) Overrides org. Format the value as octal (into
| |