public enum Unit extends Enum<Unit>
Enum Constant and Description |
---|
Centimeter |
EnglishMetricUnit |
Feet |
HalfPoint |
Inch |
JadiceDocumentUnit |
Meter |
Millimeter |
Pica |
Point |
Twip |
TypographicalPoint |
Yard |
Modifier and Type | Method and Description |
---|---|
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.
|
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
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 nameNullPointerException
- if the argument is nullpublic float convertTo(Unit dstUnit, float value)
this
unit to the given destination unit.dstUnit
- the destination (desired) unitvalue
- the valueNullPointerException
- if dstUnit is null
public double convertTo(Unit dstUnit, double value)
this
unit to the given destination unit.dstUnit
- the destination (desired) unitvalue
- the valueNullPointerException
- if dstUnit is null
public float convertFrom(Unit srcUnit, float value)
this
unit.srcUnit
- the source (current) unitvalue
- the valuethis
unitsNullPointerException
- if srcUnit is null
public double convertFrom(Unit srcUnit, double value)
this
unit.srcUnit
- the source (current) unitvalue
- the valuethis
unitsNullPointerException
- if srcUnit is null
Copyright © 2024 levigo holding gmbh. All rights reserved.