|
JScience v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavolution.lang.TextFormat<Quantity>
org.jscience.physics.quantities.QuantityFormat
public abstract class QuantityFormat
This class provides the interface for formatting and parsing
quantities.
| Nested Class Summary | |
|---|---|
static class |
QuantityFormat.Decimal
This class represents a decimal quantity format based upon a specific pattern. |
| Nested classes/interfaces inherited from class javolution.lang.TextFormat |
|---|
TextFormat.Cursor |
| Field Summary | |
|---|---|
static QuantityFormat |
EXACT_DIGITS_ONLY
Holds a quantity format instance for which only digits guaranteed to be exact are written out. |
| Constructor Summary | |
|---|---|
protected |
QuantityFormat()
Base constructor. |
| Method Summary | |
|---|---|
static QuantityFormat |
current()
Deprecated. |
static QuantityFormat |
getInstance()
Returns the local quantity
format (default EXACT_DIGITS_ONLY). |
Unit |
getOutputUnit(Quantity q)
Returns the output unit for the specified quantity. |
static void |
setCurrent(QuantityFormat format)
Sets the local quantity format. |
static void |
show(java.lang.Class<? extends Quantity> clazz,
Unit inUnit)
Shows instances of the specified class using the specified unit. |
| Methods inherited from class javolution.lang.TextFormat |
|---|
format, format, parse, parse |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final QuantityFormat EXACT_DIGITS_ONLY
"1.34 m" means a length between 1.32 m and
1.35 m.
| Constructor Detail |
|---|
protected QuantityFormat()
| Method Detail |
|---|
public static QuantityFormat getInstance()
local quantity
format (default EXACT_DIGITS_ONLY).
public static QuantityFormat current()
public static void setCurrent(QuantityFormat format)
local quantity format.
format - the new format.public Unit getOutputUnit(Quantity q)
q - the quantity for which the output unit is returned.
public static void show(java.lang.Class<? extends Quantity> clazz,
Unit inUnit)
clazz - the quantity class for which the specified
output unit has to be used.inUnit - the display unit for the specified class instances.
|
JScience v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||