public enum Unit extends Enum<Unit>
| Modifier and Type | Class and Description |
|---|---|
static interface |
Unit.UnitFormatter
A formatter for formatting the number value based on the unit
|
| Enum Constant and Description |
|---|
ch |
cm |
em |
ex |
in |
mm |
none |
pc |
percent |
pt |
px |
q |
rem |
vh |
vw |
| Modifier and Type | Method and Description |
|---|---|
String |
of(Number value)
Formats the number based on the 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 px
public static final Unit q
public static final Unit mm
public static final Unit cm
public static final Unit in
public static final Unit pt
public static final Unit pc
public static final Unit em
public static final Unit rem
public static final Unit ex
public static final Unit ch
public static final Unit vw
public static final Unit vh
public static final Unit percent
public static final Unit none
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 nullCopyright © 2019–2022 Dominokit. All rights reserved.