public enum ECSSUnit extends Enum<ECSSUnit> implements com.helger.commons.name.IHasName, ICSSVersionAware
| Enum Constant and Description |
|---|
ANGLE_DEG
Degrees.
|
ANGLE_GRAD
Gradians, also known as "gons" or "grades".
|
ANGLE_RAD
Radians.
|
ANGLE_TURN
Turns.
|
CH
width of the "0" glyph in the element's font
|
DPCM
Dots per CSS centimeter
|
DPI
Dots per CSS inch
|
DPPX
Dots per pixel centimeter
|
EM
font size of the element
|
EX
x-height of the element's font
|
FR
Flexible length or flex
|
FREQ_HZ
Hertz.
|
FREQ_KHZ
Kilohertz.
|
LENGTH_CM
centimeters
|
LENGTH_IN
inches; 1in is equal to 2.54cm
|
LENGTH_MM
millimeters; 10 millimeters = 1 centimeter
|
LENGTH_PC
picas; 1pc is equal to 12pt
|
LENGTH_PT
points; 1pt is equal to 1/72nd of 1in
|
LENGTH_Q
quarter millimeters; 40 quarter-millimeters = 1 centimeter
|
PERCENTAGE
percentage
|
PX
pixels; 1px is equal to 1/96th of 1in
|
REM
font size of the root element
|
TIME_MS
Milliseconds.
|
TIME_S
Seconds.
|
VH
Equal to 1% of the height of the initial containing block.
|
VMAX
Equal to the larger of 'vw' or 'vh'.
|
VMIN
Equal to the smaller of 'vw' or 'vh'.
|
VW
Equal to 1% of the width of the initial containing block.
|
| Modifier and Type | Field and Description |
|---|---|
static ECSSUnit |
LENGTH_PX
Length in pixel
|
| Modifier and Type | Method and Description |
|---|---|
static String |
ch(BigDecimal aValue) |
static String |
ch(double dValue) |
static String |
ch(int nValue) |
static String |
cm(BigDecimal aValue) |
static String |
cm(double dValue) |
static String |
cm(int nValue) |
static String |
deg(BigDecimal aValue) |
static String |
deg(double dValue) |
static String |
deg(int nValue) |
static String |
dpcm(BigDecimal aValue) |
static String |
dpcm(double dValue) |
static String |
dpcm(int nValue) |
static String |
dpi(BigDecimal aValue) |
static String |
dpi(double dValue) |
static String |
dpi(int nValue) |
static String |
dppx(BigDecimal aValue) |
static String |
dppx(double dValue) |
static String |
dppx(int nValue) |
static String |
em(BigDecimal aValue) |
static String |
em(double dValue) |
static String |
em(int nValue) |
static String |
ex(BigDecimal aValue) |
static String |
ex(double dValue) |
static String |
ex(int nValue) |
String |
format(BigDecimal aValue)
Get the passed value formatted with this unit.
|
String |
format(double dValue)
Get the passed value formatted with this unit.
|
String |
format(int nValue)
Get the passed value formatted with this unit
|
String |
format(long nValue)
Get the passed value formatted with this unit
|
static String |
fr(BigDecimal aValue) |
static String |
fr(double dValue) |
static String |
fr(int nValue) |
static ECSSUnit |
getFromNameOrDefault(String sName,
ECSSUnit eDefault) |
static ECSSUnit |
getFromNameOrNull(String sName) |
ECSSMetaUnit |
getMetaUnit() |
ECSSVersion |
getMinimumCSSVersion() |
String |
getName() |
static String |
grad(BigDecimal aValue) |
static String |
grad(double dValue) |
static String |
grad(int nValue) |
static String |
hz(BigDecimal aValue) |
static String |
hz(double dValue) |
static String |
hz(int nValue) |
static String |
in(BigDecimal aValue) |
static String |
in(double dValue) |
static String |
in(int nValue) |
static String |
khz(BigDecimal aValue) |
static String |
khz(double dValue) |
static String |
khz(int nValue) |
static String |
mm(BigDecimal aValue) |
static String |
mm(double dValue) |
static String |
mm(int nValue) |
static String |
ms(BigDecimal aValue) |
static String |
ms(double dValue) |
static String |
ms(int nValue) |
static String |
pc(BigDecimal aValue) |
static String |
pc(double dValue) |
static String |
pc(int nValue) |
static String |
perc(BigDecimal aValue) |
static String |
perc(double dValue) |
static String |
perc(int nValue) |
static String |
pt(BigDecimal aValue) |
static String |
pt(double dValue) |
static String |
pt(int nValue) |
static String |
px(BigDecimal aValue) |
static String |
px(double dValue) |
static String |
px(int nValue) |
static String |
q(BigDecimal aValue) |
static String |
q(double dValue) |
static String |
q(int nValue) |
static String |
rad(BigDecimal aValue) |
static String |
rad(double dValue) |
static String |
rad(int nValue) |
static String |
rem(BigDecimal aValue) |
static String |
rem(double dValue) |
static String |
rem(int nValue) |
static String |
s(BigDecimal aValue) |
static String |
s(double dValue) |
static String |
s(int nValue) |
static String |
turn(BigDecimal aValue) |
static String |
turn(double dValue) |
static String |
turn(int nValue) |
static ECSSUnit |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ECSSUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
static String |
vh(BigDecimal aValue) |
static String |
vh(double dValue) |
static String |
vh(int nValue) |
static String |
vmax(BigDecimal aValue) |
static String |
vmax(double dValue) |
static String |
vmax(int nValue) |
static String |
vmin(BigDecimal aValue) |
static String |
vmin(double dValue) |
static String |
vmin(int nValue) |
static String |
vw(BigDecimal aValue) |
static String |
vw(double dValue) |
static String |
vw(int nValue) |
static String |
zero() |
public static final ECSSUnit EM
public static final ECSSUnit EX
public static final ECSSUnit PX
public static final ECSSUnit CH
public static final ECSSUnit REM
public static final ECSSUnit VW
public static final ECSSUnit VH
public static final ECSSUnit VMIN
public static final ECSSUnit VMAX
public static final ECSSUnit LENGTH_IN
public static final ECSSUnit LENGTH_CM
public static final ECSSUnit LENGTH_MM
public static final ECSSUnit LENGTH_Q
public static final ECSSUnit LENGTH_PT
public static final ECSSUnit LENGTH_PC
public static final ECSSUnit PERCENTAGE
public static final ECSSUnit ANGLE_DEG
public static final ECSSUnit ANGLE_RAD
public static final ECSSUnit ANGLE_GRAD
public static final ECSSUnit ANGLE_TURN
public static final ECSSUnit TIME_MS
public static final ECSSUnit TIME_S
public static final ECSSUnit FREQ_HZ
public static final ECSSUnit FREQ_KHZ
public static final ECSSUnit DPI
public static final ECSSUnit DPCM
public static final ECSSUnit DPPX
public static final ECSSUnit FR
public static final ECSSUnit LENGTH_PX
public static ECSSUnit[] values()
for (ECSSUnit c : ECSSUnit.values()) System.out.println(c);
public static ECSSUnit 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 null@Nonnull @Nonempty public String getName()
getName in interface com.helger.commons.name.IHasName@Nonnull public ECSSMetaUnit getMetaUnit()
null.@Nonnull public ECSSVersion getMinimumCSSVersion()
getMinimumCSSVersion in interface ICSSVersionAwarenull.@Nonnull @Nonempty public String format(int nValue)
nValue - Value to formatvalue + getName()@Nonnull @Nonempty public String format(long nValue)
nValue - Value to formatvalue + getName()@Nonnull @Nonempty public String format(double dValue)
dValue - Value to formatvalue + getName()@Nonnull @Nonempty public String format(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + getName()@Nullable public static ECSSUnit getFromNameOrDefault(@Nullable String sName, @Nullable ECSSUnit eDefault)
@Nonnull @Nonempty public static String em(int nValue)
nValue - value to formatvalue + "em"@Nonnull @Nonempty public static String em(double dValue)
dValue - value to formatvalue + "em"@Nonnull @Nonempty public static String em(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "em"@Nonnull @Nonempty public static String ex(int nValue)
nValue - value to formatvalue + "ex"@Nonnull @Nonempty public static String ex(double dValue)
dValue - value to formatvalue + "ex"@Nonnull @Nonempty public static String ex(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "ex"@Nonnull @Nonempty public static String px(int nValue)
nValue - value to formatvalue + "px"@Nonnull @Nonempty public static String px(double dValue)
dValue - value to formatvalue + "px"@Nonnull @Nonempty public static String px(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "px"@Nonnull @Nonempty public static String rem(int nValue)
nValue - value to formatvalue + "rem"@Nonnull @Nonempty public static String rem(double dValue)
dValue - value to formatvalue + "rem"@Nonnull @Nonempty public static String rem(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "rem"@Nonnull @Nonempty public static String vw(int nValue)
nValue - value to formatvalue + "vw"@Nonnull @Nonempty public static String vw(double dValue)
dValue - value to formatvalue + "vw"@Nonnull @Nonempty public static String vw(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "vw"@Nonnull @Nonempty public static String vh(int nValue)
nValue - value to formatvalue + "vh"@Nonnull @Nonempty public static String vh(double dValue)
dValue - value to formatvalue + "vh"@Nonnull @Nonempty public static String vh(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "vh"@Nonnull @Nonempty public static String vmin(int nValue)
nValue - value to formatvalue + "vmin"@Nonnull @Nonempty public static String vmin(double dValue)
dValue - value to formatvalue + "vmin"@Nonnull @Nonempty public static String vmin(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "vmin"@Nonnull @Nonempty public static String vmax(int nValue)
nValue - value to formatvalue + "vmax"@Nonnull @Nonempty public static String vmax(double dValue)
dValue - value to formatvalue + "vmax"@Nonnull @Nonempty public static String vmax(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "vmax"@Nonnull @Nonempty public static String ch(int nValue)
nValue - value to formatvalue + "ch"@Nonnull @Nonempty public static String ch(double dValue)
dValue - value to formatvalue + "ch"@Nonnull @Nonempty public static String ch(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "ch"@Nonnull @Nonempty public static String in(int nValue)
nValue - value to formatvalue + "in"@Nonnull @Nonempty public static String in(double dValue)
dValue - value to formatvalue + "in"@Nonnull @Nonempty public static String in(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "in"@Nonnull @Nonempty public static String cm(int nValue)
nValue - value to formatvalue + "cm"@Nonnull @Nonempty public static String cm(double dValue)
dValue - value to formatvalue + "cm"@Nonnull @Nonempty public static String cm(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "cm"@Nonnull @Nonempty public static String mm(int nValue)
nValue - value to formatvalue + "mm"@Nonnull @Nonempty public static String mm(double dValue)
dValue - value to formatvalue + "mm"@Nonnull @Nonempty public static String mm(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "mm"@Nonnull @Nonempty public static String q(int nValue)
nValue - value to formatvalue + "q"@Nonnull @Nonempty public static String q(double dValue)
dValue - value to formatvalue + "q"@Nonnull @Nonempty public static String q(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "q"@Nonnull @Nonempty public static String pt(int nValue)
nValue - value to formatvalue + "pt"@Nonnull @Nonempty public static String pt(double dValue)
dValue - value to formatvalue + "pt"@Nonnull @Nonempty public static String pt(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "pt"@Nonnull @Nonempty public static String pc(int nValue)
nValue - value to formatvalue + "pc"@Nonnull @Nonempty public static String pc(double dValue)
dValue - value to formatvalue + "pc"@Nonnull @Nonempty public static String pc(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "pc"@Nonnull @Nonempty public static String perc(int nValue)
nValue - value to formatvalue + "%"@Nonnull @Nonempty public static String perc(double dValue)
dValue - value to formatvalue + "%"@Nonnull @Nonempty public static String perc(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "%"@Nonnull @Nonempty public static String deg(int nValue)
nValue - value to formatvalue + "deg"@Nonnull @Nonempty public static String deg(double dValue)
dValue - value to formatvalue + "deg"@Nonnull @Nonempty public static String deg(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "deg"@Nonnull @Nonempty public static String rad(int nValue)
nValue - value to formatvalue + "rad"@Nonnull @Nonempty public static String rad(double dValue)
dValue - value to formatvalue + "rad"@Nonnull @Nonempty public static String rad(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "rad"@Nonnull @Nonempty public static String grad(int nValue)
nValue - value to formatvalue + "grad"@Nonnull @Nonempty public static String grad(double dValue)
dValue - value to formatvalue + "grad"@Nonnull @Nonempty public static String grad(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "grad"@Nonnull @Nonempty public static String turn(int nValue)
nValue - value to formatvalue + "turn"@Nonnull @Nonempty public static String turn(double dValue)
dValue - value to formatvalue + "turn"@Nonnull @Nonempty public static String turn(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "turn"@Nonnull @Nonempty public static String ms(int nValue)
nValue - value to formatvalue + "ms"@Nonnull @Nonempty public static String ms(double dValue)
dValue - value to formatvalue + "ms"@Nonnull @Nonempty public static String ms(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "ms"@Nonnull @Nonempty public static String s(int nValue)
nValue - value to formatvalue + "s"@Nonnull @Nonempty public static String s(double dValue)
dValue - value to formatvalue + "s"@Nonnull @Nonempty public static String s(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "s"@Nonnull @Nonempty public static String hz(int nValue)
nValue - value to formatvalue + "hz"@Nonnull @Nonempty public static String hz(double dValue)
dValue - value to formatvalue + "hz"@Nonnull @Nonempty public static String hz(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "hz"@Nonnull @Nonempty public static String khz(int nValue)
nValue - value to formatvalue + "khz"@Nonnull @Nonempty public static String khz(double dValue)
dValue - value to formatvalue + "khz"@Nonnull @Nonempty public static String khz(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "khz"@Nonnull @Nonempty public static String dpi(int nValue)
nValue - value to formatvalue + "dpi"@Nonnull @Nonempty public static String dpi(double dValue)
dValue - value to formatvalue + "dpi"@Nonnull @Nonempty public static String dpi(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "dpi"@Nonnull @Nonempty public static String dpcm(int nValue)
nValue - value to formatvalue + "dpcm"@Nonnull @Nonempty public static String dpcm(double dValue)
dValue - value to formatvalue + "dpcm"@Nonnull @Nonempty public static String dpcm(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "dpcm"@Nonnull @Nonempty public static String dppx(int nValue)
nValue - value to formatvalue + "dppx"@Nonnull @Nonempty public static String dppx(double dValue)
dValue - value to formatvalue + "dppx"@Nonnull @Nonempty public static String dppx(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "dppx"@Nonnull @Nonempty public static String fr(int nValue)
nValue - value to formatvalue + "fr"@Nonnull @Nonempty public static String fr(double dValue)
dValue - value to formatvalue + "fr"@Nonnull @Nonempty public static String fr(@Nonnull BigDecimal aValue)
aValue - Value to format. May not be null.value + "fr"Copyright © 2014–2018 Philip Helger. All rights reserved.