Package com.levigo.jadice.document
Enum Class Unit
- All Implemented Interfaces:
Serializable
,Comparable<Unit>
,Constable
An enum of various common length units.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptiondouble
convertFrom
(Unit srcUnit, double value) Convert the given value in the given destination unit tothis
unit.float
convertFrom
(Unit srcUnit, float value) Convert the given value in the given destination unit tothis
unit.double
Convert the given value inthis
unit to the given destination unit.float
Convert the given value inthis
unit to the given destination unit.static Unit
Returns the enum constant of this class with the specified name.static Unit[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
Inch
-
Point
-
HalfPoint
-
Twip
-
EnglishMetricUnit
-
Feet
-
Yard
-
Millimeter
-
Centimeter
-
Meter
-
Pica
-
TypographicalPoint
-
JadiceDocumentUnit
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
convertTo
Convert the given value inthis
unit to the given destination unit.- Parameters:
dstUnit
- the destination (desired) unitvalue
- the value- Returns:
- the value in destination units
- Throws:
NullPointerException
- if dstUnit isnull
-
convertTo
Convert the given value inthis
unit to the given destination unit.- Parameters:
dstUnit
- the destination (desired) unitvalue
- the value- Returns:
- the value in destination units
- Throws:
NullPointerException
- if dstUnit isnull
-
convertFrom
Convert the given value in the given destination unit tothis
unit.- Parameters:
srcUnit
- the source (current) unitvalue
- the value- Returns:
- the value in
this
units - Throws:
NullPointerException
- if srcUnit isnull
-
convertFrom
Convert the given value in the given destination unit tothis
unit.- Parameters:
srcUnit
- the source (current) unitvalue
- the value- Returns:
- the value in
this
units - Throws:
NullPointerException
- if srcUnit isnull
-