|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.units.Unit
Placeholder for future Unit
class. This
skeleton will be removed when the real classes (from
JSR-108:
Units specification) will be publicly available.
IMPORTANT: future version will NOT be compatible
will this one. Remind, this is a temporary class!
Field Summary | |
static Unit |
BRITISHYARD
British yard; unit of length. |
static Unit |
DAY
Unit of time. |
static Unit |
DEGREE
Unit of angle. |
static Unit |
METRE
Base unit of length. |
static Unit |
MILLISECOND
Unit of time. |
private static java.util.Map |
pool
Pool of units. |
private double |
scale
The scale factor. |
static Unit |
SECOND
Base unit of time. |
private java.lang.String |
symbol
The unit's symbol. |
private Unit |
unit
Base unit, or this if none. |
Constructor Summary | |
private |
Unit(java.lang.String symbol)
Unit constructor. |
private |
Unit(java.lang.String symbol,
double scale,
Unit unit)
Unit constructor. |
Method Summary | |
boolean |
canConvert(Unit other)
Check if amount of the specified unit can be converted into amount of this unit. |
double |
convert(double value,
Unit unit)
Convert a value from one unit to an other. |
boolean |
equals(java.lang.Object object)
Compare this unit symbol with the specified object for equality. |
static Unit |
get(java.lang.String symbol)
Returns an unit instance. |
int |
hashCode()
Returns a hash code value. |
java.lang.String |
toString()
Returns a string representation of this unit's symbol. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final java.util.Map pool
public static final Unit DEGREE
public static final Unit METRE
public static final Unit BRITISHYARD
public static final Unit SECOND
public static final Unit MILLISECOND
public static final Unit DAY
private final java.lang.String symbol
private final double scale
private final Unit unit
this
if none.
Constructor Detail |
private Unit(java.lang.String symbol)
private Unit(java.lang.String symbol, double scale, Unit unit)
Method Detail |
public static Unit get(java.lang.String symbol)
public boolean canConvert(Unit other)
public double convert(double value, Unit unit)
public java.lang.String toString()
public int hashCode()
public boolean equals(java.lang.Object object)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |