Class UnitStringToId

java.lang.Object
io.sf.carte.doc.style.css.UnitStringToId

public class UnitStringToId extends Object
Obtain the numeric unit from the unit string.

The benchmarks used to choose the implementation are available in the UnitStringToNumberMark class in the css4j Benchmarks repository.

  • Constructor Details

    • UnitStringToId

      public UnitStringToId()
  • Method Details

    • unitFromString

      public static short unitFromString(String unit)
      Retrieves the CSS unit associated to the given unit string.
      Parameters:
      unit - the unit string.
      Returns:
      the associated CSS unit, or CSS_OTHER if the unit is not known.