Class PercentageEvaluator

java.lang.Object
io.sf.carte.doc.style.css.property.Evaluator
io.sf.carte.doc.style.css.property.PercentageEvaluator

public class PercentageEvaluator extends Evaluator
Evaluates expressions with only percentages and plain numbers.
  • Constructor Details

    • PercentageEvaluator

      public PercentageEvaluator()
  • Method Details

    • absoluteTypedValue

      protected TypedValue absoluteTypedValue(TypedValue partialValue)
      Overrides:
      absoluteTypedValue in class Evaluator
    • percentage

      protected float percentage(CSSTypedValue value, short resultType) throws DOMException
      Obtain the float value (in the requested absolute unit) corresponding to the given percentage value.
      Overrides:
      percentage in class Evaluator
      Parameters:
      value - the percentage value.
      resultType - the desired absolute result type.
      Returns:
      the absolute float value in the requested unit.
      Throws:
      DOMException - if the percentage could not be converted to the requested unit.