public class Length
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.util.regex.Pattern |
PATTERN |
static java.lang.String |
TAG |
protected StyledElement.Unit |
unit |
protected java.lang.Double |
value |
Constructor and Description |
---|
Length(double value,
StyledElement.Unit unit)
Initializes a Length object using the given numeric value and Unit specification.
|
Length(java.lang.String expression)
Initializes a Length object by parsing the given expression.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
StyledElement.Unit |
getUnit()
The
StyledElement.Unit of this Length. |
double |
getValue()
The numeric value of this Length.
|
int |
hashCode() |
public static final java.lang.String TAG
public static final java.util.regex.Pattern PATTERN
protected java.lang.Double value
protected StyledElement.Unit unit
public Length(java.lang.String expression)
expression
- the string expression to parsepublic Length(double value, StyledElement.Unit unit)
value
- the numeric value of the lengthunit
- the units for the length valuepublic double getValue()
public StyledElement.Unit getUnit()
StyledElement.Unit
of this Length.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object