Minus signs are only allowed in the whole number part - i.e.,
"-3 1/2" is legitimate and denotes -7/2, but "-3 -1/2" is invalid and
will result in a ParseException.
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
Hides org. |
| private NumberFormat | wholeFormat
The format used for the whole number. |
| Access | Constructor and Description |
|---|---|
| public | ProperBigFractionFormat()
Create a proper formatting instance with the default number format for the whole, numerator, and denominator. |
| public | ProperBigFractionFormat(final NumberFormat
the custom format for the whole, numerator, and
denominator. format)Create a proper formatting instance with a custom number format for the whole, numerator, and denominator. |
| public | ProperBigFractionFormat(final NumberFormat
the custom format for the whole. wholeFormat, final NumberFormat the custom format for the numerator. numeratorFormat, final NumberFormat the custom format for the denominator. denominatorFormat)Create a proper formatting instance with a custom number format for each of the whole, numerator, and denominator. |
| Modifier and Type | Method and Description |
|---|---|
| public StringBuffer | Returns: the value passed in as toAppendTo.the object to format. fraction, final StringBuffer where the text is to be appended toAppendTo, final FieldPosition On input: an alignment field, if desired. On output: the
offsets of the alignment field pos)Overrides org. Formats a |
| public NumberFormat | |
| public BigFraction | Returns: the parsedBigFraction object.the string to parse source, final ParsePosition input/ouput parsing parameter. pos)Overrides org. Parses a string to produce a |
| public void |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. Serializable version identifier | |
| wholeFormat | back to summary |
|---|---|
| private NumberFormat wholeFormat The format used for the whole number. | |
| ProperBigFractionFormat | back to summary |
|---|---|
| public ProperBigFractionFormat() Create a proper formatting instance with the default number format for the whole, numerator, and denominator. | |
| ProperBigFractionFormat | back to summary |
|---|---|
| public ProperBigFractionFormat(final NumberFormat format) Create a proper formatting instance with a custom number format for the whole, numerator, and denominator.
| |
| ProperBigFractionFormat | back to summary |
|---|---|
| public ProperBigFractionFormat(final NumberFormat wholeFormat, final NumberFormat numeratorFormat, final NumberFormat denominatorFormat) Create a proper formatting instance with a custom number format for each of the whole, numerator, and denominator.
| |
| format | back to summary |
|---|---|
| public StringBuffer format(final BigFraction fraction, final StringBuffer toAppendTo, final FieldPosition pos) Overrides org. Formats a
| |
| getWholeFormat | back to summary |
|---|---|
| public NumberFormat getWholeFormat() Access the whole format.
| |
| parse | back to summary |
|---|---|
| public BigFraction parse(final String source, final ParsePosition pos) Overrides org. Parses a string to produce a
Minus signs are only allowed in the whole number part - i.e.,
"-3 1/2" is legitimate and denotes -7/2, but "-3 -1/2" is invalid and
will result in a
| |
| setWholeFormat | back to summary |
|---|---|
| public void setWholeFormat(final NumberFormat format) Modify the whole format.
| |