Pattern letters are usually repeated, as their number determines the exact presentation:
Letter Quantity Component Presentation Examples nNumeric value Number 27uUnit Text m~Mixed radix Text 1 m; 27cm
"~" is followed by a character sequence acting as mixed radix delimiter. This character sequence must not contain "~" itself or any numeric values.| Modifier and Type | Field and Description |
|---|---|
| private static final SimpleQuantityFormat | DEFAULT
Holds the default format instance. |
| private String | |
| private String | |
| private static final String | |
| private final String | pattern
The pattern string of this formatter. |
| private static final String | |
| private static final long | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public | SimpleQuantityFormat(String
the pattern describing the quantity and unit format pattern)Constructs a |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public Appendable | format(Quantity<?>
the quantity to format. quantity, Appendable the appendable destination. dest)Implements abstract tech. Implements javax. Formats the specified quantity into an |
| protected StringBuffer | formatMixed(MixedQuantity<?>
the mixed quantity to format. mixed, StringBuffer the appendable destination. dest)Implements abstract tech. Convenience method equivalent to |
| public static SimpleQuantityFormat | Returns: a defaultSimpleQuantityFormat instance.Returns the quantity format for the default locale. |
| public static SimpleQuantityFormat | Returns: SimpleQuantityFormat.getInstance(a pattern)the pattern describing the quantity and unit format pattern)Returns a |
| public String | |
| public Quantity | parse(CharSequence
the csq, ParsePosition CharSequence to parse.the cursor holding the current parsing index. cursor)Implements abstract tech. Implements javax. Parses a portion of the specified |
| protected Quantity | parse(CharSequence
the csq, int CharSequence to parse.the current parsing index. index)Implements abstract tech. Parses a portion of the specified |
| public Quantity | parse(CharSequence
the csq)CharSequence to parse.Implements abstract tech. Implements javax. Parses a portion of the specified |
| public String |
| DEFAULT | back to summary |
|---|---|
| private static final SimpleQuantityFormat DEFAULT Holds the default format instance. | |
| delimiter | back to summary |
|---|---|
| private String delimiter | |
| mixDelimiter | back to summary |
|---|---|
| private String mixDelimiter | |
| NUM_PART | back to summary |
|---|---|
| private static final String NUM_PART | |
| pattern | back to summary |
|---|---|
| private final String pattern The pattern string of this formatter. This is always a non-localized pattern. May not be null. See class documentation for details. | |
| RADIX | back to summary |
|---|---|
| private static final String RADIX | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides tech. | |
| UNIT_PART | back to summary |
|---|---|
| private static final String UNIT_PART | |
| SimpleQuantityFormat | back to summary |
|---|---|
| public SimpleQuantityFormat(String pattern) Constructs a
| |
| SimpleQuantityFormat | back to summary |
|---|---|
| protected SimpleQuantityFormat() Constructs a | |
| format | back to summary |
|---|---|
| public Appendable format(Quantity<?> quantity, Appendable dest) throws IOException Implements abstract tech. Implements javax. Doc from tech. Formats the specified quantity into an
| |
| formatMixed | back to summary |
|---|---|
| protected StringBuffer formatMixed(MixedQuantity<?> mixed, StringBuffer dest) Implements abstract tech. Doc from tech. Convenience method equivalent to
| |
| getInstance | back to summary |
|---|---|
| public static SimpleQuantityFormat getInstance() Returns the quantity format for the default locale. The default format
assumes the quantity is composed of a decimal number and a
| |
| getInstance | back to summary |
|---|---|
| public static SimpleQuantityFormat getInstance(String pattern) Returns a
| |
| getPattern | back to summary |
|---|---|
| public String getPattern() Returns the pattern of this format.
| |
| parse | back to summary |
|---|---|
| public Quantity Implements abstract tech. Implements javax. Doc from tech. Parses a portion of the specified
| |
| parse | back to summary |
|---|---|
| protected Quantity Implements abstract tech. Doc from tech. Parses a portion of the specified
| |
| parse | back to summary |
|---|---|
| public Quantity Implements abstract tech. Implements javax. Doc from tech. Parses a portion of the specified
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |