|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Object java.lang.Enum<Unit> com.levigo.jadice.document.Unit
public enum Unit
An enum of various common length units.
Enum Constant Summary | |
---|---|
Centimeter
|
|
EnglishMetricUnit
|
|
Feet
|
|
HalfPoint
|
|
Inch
|
|
JadiceDocumentUnit
|
|
Meter
|
|
Millimeter
|
|
Pica
|
|
Point
|
|
Twip
|
|
TypographicalPoint
|
|
Yard
|
Method Summary | |
---|---|
double |
convertFrom(Unit srcUnit,
double value)
Convert the given value in the given destination unit to this unit. |
float |
convertFrom(Unit srcUnit,
float value)
Convert the given value in the given destination unit to this unit. |
double |
convertTo(Unit dstUnit,
double value)
Convert the given value in this unit to the given destination unit. |
float |
convertTo(Unit dstUnit,
float value)
Convert the given value in this unit to the given destination unit. |
static Unit |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static Unit[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final Unit Inch
public static final Unit Point
public static final Unit HalfPoint
public static final Unit Twip
public static final Unit EnglishMetricUnit
public static final Unit Feet
public static final Unit Yard
public static final Unit Millimeter
public static final Unit Centimeter
public static final Unit Meter
public static final Unit Pica
public static final Unit TypographicalPoint
public static final Unit JadiceDocumentUnit
Method Detail |
---|
public static Unit[] values()
for (Unit c : Unit.values()) System.out.println(c);
public static Unit valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic float convertTo(Unit dstUnit, float value)
this
unit to the given destination unit.
dstUnit
- the destination (desired) unitvalue
- the value
NullPointerException
- if dstUnit is null
public double convertTo(Unit dstUnit, double value)
this
unit to the given destination unit.
dstUnit
- the destination (desired) unitvalue
- the value
NullPointerException
- if dstUnit is null
public float convertFrom(Unit srcUnit, float value)
this
unit.
srcUnit
- the source (current) unitvalue
- the value
this
units
NullPointerException
- if srcUnit is null
public double convertFrom(Unit srcUnit, double value)
this
unit.
srcUnit
- the source (current) unitvalue
- the value
this
units
NullPointerException
- if srcUnit is null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |