Class Length

java.lang.Object
com.brightcove.player.model.Length
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
LengthVtt

public class Length extends Object implements Serializable
Provides the representation of varying forms of length measure per the TTML specification.
See Also:
  • Field Details

  • Constructor Details

    • Length

      public Length(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
      Examples:
      • 4.5%
      • 200px
      • 22ems
      Parameters:
      expression - the string expression to parse
      See Also:
    • 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 length
      unit - the units for the length value
  • Method Details

    • getValue

      public double getValue()
      The numeric value of this Length.
      Returns:
      the double value
    • getUnit

      public StyledElement.Unit getUnit()
      The StyledElement.Unit of this Length.
      Returns:
      the unit
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object