Package com.brightcove.player.model
Class Length
- java.lang.Object
-
- com.brightcove.player.model.Length
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
LengthVtt
public class Length extends java.lang.Object implements java.io.SerializableProvides the representation of varying forms of length measure per the TTML specification.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.regex.PatternPATTERNstatic java.lang.StringTAGprotected StyledElement.Unitunitprotected java.lang.Doublevalue
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)StyledElement.UnitgetUnit()TheStyledElement.Unitof this Length.doublegetValue()The numeric value of this Length.inthashCode()
-
-
-
Field Detail
-
TAG
public static final java.lang.String TAG
-
PATTERN
public static final java.util.regex.Pattern PATTERN
-
value
protected java.lang.Double value
-
unit
protected StyledElement.Unit unit
-
-
Constructor Detail
-
Length
public Length(java.lang.String expression)
Initializes a Length object by parsing the given expression. Valid expressions are those that include a decimal numeric value followed by one of the recognized unit suffixes:- %
- px
- ems
- 4.5%
- 200px
- 22ems
- Parameters:
expression- the string expression to parse- See Also:
- http://www.w3.org/TR/ttaf1-dfxp/#style-value-length
-
Length
public Length(double value, StyledElement.Unit unit)Initializes a Length object using the given numeric value and Unit specification.- Parameters:
value- the numeric value of the lengthunit- the units for the length value
-
-
Method Detail
-
getValue
public double getValue()
The numeric value of this Length.- Returns:
- the double value
-
getUnit
public StyledElement.Unit getUnit()
TheStyledElement.Unitof this Length.- Returns:
- the unit
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-