Package com.pdftools.geometry.units
Enum Length.Units
- java.lang.Object
-
- java.lang.Enum<Length.Units>
-
- com.pdftools.geometry.units.Length.Units
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Length.Units>
- Enclosing class:
- Length
public static enum Length.Units extends java.lang.Enum<Length.Units>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CENTIMETRE
The centimetre, symbol cm, equal to0.01m
.INCH
The inch, symbol in, equal to25.4mm
or72pt
.KILOMETRE
The kilometre, symbol km, equal to1000m
.METRE
The metre, symbol m, is the SI unit of length.MILLIMETRE
The millimetre, symbol mm, equal to0.001m
.POINT
The point, symbol pt, is the default unit used in PDF documents, equal to1/72in
or25.4/72mm
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Length.Units
get(java.lang.String symbol)
Get the unit enum value from its symbol, e.g.java.lang.String
getSymbol()
Get the unit's symbol name.java.lang.String
toString()
static Length.Units
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Length.Units[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
METRE
public static final Length.Units METRE
The metre, symbol m, is the SI unit of length.
-
POINT
public static final Length.Units POINT
The point, symbol pt, is the default unit used in PDF documents, equal to1/72in
or25.4/72mm
. This is the unit used internally by theLength
object.
-
KILOMETRE
public static final Length.Units KILOMETRE
The kilometre, symbol km, equal to1000m
.
-
CENTIMETRE
public static final Length.Units CENTIMETRE
The centimetre, symbol cm, equal to0.01m
.
-
MILLIMETRE
public static final Length.Units MILLIMETRE
The millimetre, symbol mm, equal to0.001m
.
-
INCH
public static final Length.Units INCH
The inch, symbol in, equal to25.4mm
or72pt
.
-
-
Method Detail
-
values
public static Length.Units[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Length.Units c : Length.Units.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Length.Units valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getSymbol
public java.lang.String getSymbol()
Get the unit's symbol name.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<Length.Units>
-
get
public static Length.Units get(java.lang.String symbol)
Get the unit enum value from its symbol, e.g. m, or in.- Parameters:
symbol
- the symbol, e.g. m, or in.- Returns:
-
-