public class SimpleQuantityFormat extends AbstractQuantityFormat
Format.Field| Constructor and Description |
|---|
SimpleQuantityFormat() |
| Modifier and Type | Method and Description |
|---|---|
Appendable |
format(javax.measure.Quantity quantity,
Appendable dest)
Formats the specified quantity into an
Appendable. |
static SimpleQuantityFormat |
getInstance()
Returns the quantity format for the default locale.
|
javax.measure.Quantity<?> |
parse(CharSequence csq)
Parses a portion of the specified
CharSequence from the specified position to produce an object. |
javax.measure.Quantity<?> |
parse(CharSequence csq,
ParsePosition cursor)
Parses a portion of the specified
CharSequence from the specified position to produce an object. |
format, format, format, parseObjectclone, format, formatToCharacterIterator, parseObjectpublic SimpleQuantityFormat()
public Appendable format(javax.measure.Quantity quantity, Appendable dest) throws IOException
AbstractQuantityFormatAppendable.format in interface javax.measure.format.QuantityFormatformat in class AbstractQuantityFormatquantity - the quantity to format.dest - the appendable destination.Appendable.IOException - if an I/O exception occurs.public javax.measure.Quantity<?> parse(CharSequence csq, ParsePosition cursor) throws javax.measure.format.MeasurementParseException
AbstractQuantityFormatCharSequence from the specified position to produce an object. If parsing succeeds, then the index
of the cursor argument is updated to the index after the last character used.parse in interface javax.measure.format.QuantityFormatparse in class AbstractQuantityFormatcsq - the CharSequence to parse.cursor - the cursor holding the current parsing index.javax.measure.format.MeasurementParseExceptionpublic javax.measure.Quantity<?> parse(CharSequence csq) throws javax.measure.format.MeasurementParseException
AbstractQuantityFormatCharSequence from the specified position to produce an object. If parsing succeeds, then the index
of the cursor argument is updated to the index after the last character used.parse in interface javax.measure.format.QuantityFormatparse in interface tech.uom.lib.common.function.Parser<CharSequence,javax.measure.Quantity>parse in class AbstractQuantityFormatcsq - the CharSequence to parse.javax.measure.format.MeasurementParseExceptionpublic static SimpleQuantityFormat getInstance()
Unit
separated by whitespace(s).MeasureFormat.getInstance(NumberFormat.getInstance(), UnitFormat.getInstance())Copyright © 2005–2024 Units of Measurement project. All rights reserved.