FractionFormat and BigFractionFormat.
| Modifier and Type | Field and Description |
|---|---|
| private NumberFormat | denominatorFormat
The format used for the denominator. |
| private NumberFormat | numeratorFormat
The format used for the numerator. |
| private static final long | serialVersionUID
Serializable version identifier.
|
| Access | Constructor and Description |
|---|---|
| protected | AbstractFormat()
Create an improper formatting instance with the default number format for the numerator and denominator. |
| protected | AbstractFormat(final NumberFormat
the custom format for both the numerator and denominator. format)Create an improper formatting instance with a custom number format for both the numerator and denominator. |
| protected | AbstractFormat(final NumberFormat
the custom format for the numerator. numeratorFormat, final NumberFormat the custom format for the denominator. denominatorFormat)Create an improper formatting instance with a custom number format for the numerator and a custom number format for the denominator. |
| Modifier and Type | Method and Description |
|---|---|
| public StringBuffer | Returns: a reference to the appended bufferthe double value to format value, final StringBuffer StringBuffer to append to buffer, final FieldPosition On input: an alignment field, if desired. On output: the
offsets of the alignment field position)Implements abstract java. Formats a double value as a fraction and appends the result to a StringBuffer. |
| public StringBuffer | Returns: a reference to the appended bufferthe long value to format value, final StringBuffer StringBuffer to append to buffer, final FieldPosition On input: an alignment field, if desired. On output: the
offsets of the alignment field position)Implements abstract java. Formats a long value as a fraction and appends the result to a StringBuffer. |
| protected static NumberFormat | |
| protected static NumberFormat | Returns: the default number format specific to the given locale.the specific locale used by the format. locale)Create a default number format. |
| public NumberFormat | |
| public NumberFormat | |
| protected static void | parseAndIgnoreWhitespace(final String
the string to parse source, final ParsePosition input/output parsing parameter. On output, pos)pos
holds the index of the next non-whitespace character.Parses |
| protected static char | Returns: the first non-whitespace character.the string to parse source, final ParsePosition input/output parsing parameter. pos)Parses |
| public void | setDenominatorFormat(final NumberFormat
the new denominator format value. format)Modify the denominator format. |
| public void | setNumeratorFormat(final NumberFormat
the new numerator format value. format)Modify the numerator format. |
| denominatorFormat | back to summary |
|---|---|
| private NumberFormat denominatorFormat The format used for the denominator. | |
| numeratorFormat | back to summary |
|---|---|
| private NumberFormat numeratorFormat The format used for the numerator. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. Serializable version identifier. | |
| AbstractFormat | back to summary |
|---|---|
| protected AbstractFormat() Create an improper formatting instance with the default number format for the numerator and denominator. | |
| AbstractFormat | back to summary |
|---|---|
| protected AbstractFormat(final NumberFormat format) Create an improper formatting instance with a custom number format for both the numerator and denominator.
| |
| AbstractFormat | back to summary |
|---|---|
| protected AbstractFormat(final NumberFormat numeratorFormat, final NumberFormat denominatorFormat) Create an improper formatting instance with a custom number format for the numerator and a custom number format for the denominator.
| |
| format | back to summary |
|---|---|
| public StringBuffer format(final double value, final StringBuffer buffer, final FieldPosition position) Implements abstract java. Formats a double value as a fraction and appends the result to a StringBuffer.
| |
| format | back to summary |
|---|---|
| public StringBuffer format(final long value, final StringBuffer buffer, final FieldPosition position) Implements abstract java. Formats a long value as a fraction and appends the result to a StringBuffer.
| |
| getDefaultNumberFormat | back to summary |
|---|---|
| protected static NumberFormat getDefaultNumberFormat() Create a default number format. The default number format is based on
| |
| getDefaultNumberFormat | back to summary |
|---|---|
| protected static NumberFormat getDefaultNumberFormat(final Locale locale) Create a default number format. The default number format is based on
| |
| getDenominatorFormat | back to summary |
|---|---|
| public NumberFormat getDenominatorFormat() Access the denominator format.
| |
| getNumeratorFormat | back to summary |
|---|---|
| public NumberFormat getNumeratorFormat() Access the numerator format.
| |
| parseAndIgnoreWhitespace | back to summary |
|---|---|
| protected static void parseAndIgnoreWhitespace(final String source, final ParsePosition pos) Parses
| |
| parseNextCharacter | back to summary |
|---|---|
| protected static char parseNextCharacter(final String source, final ParsePosition pos) Parses
| |
| setDenominatorFormat | back to summary |
|---|---|
| public void setDenominatorFormat(final NumberFormat format) Modify the denominator format.
| |
| setNumeratorFormat | back to summary |
|---|---|
| public void setNumeratorFormat(final NumberFormat format) Modify the numerator format.
| |