Class PercentageEvaluator
java.lang.Object
io.sf.carte.doc.style.css.property.Evaluator
io.sf.carte.doc.style.css.property.PercentageEvaluator
Evaluates expressions with only percentages and plain numbers.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected TypedValue
absoluteTypedValue
(TypedValue partialValue) protected float
percentage
(CSSTypedValue value, short resultType) Obtain the float value (in the requested absolute unit) corresponding to the given percentage value.Methods inherited from class io.sf.carte.doc.style.css.property.Evaluator
absoluteProxyValue, absoluteValue, evaluateExpression, evaluateFunction
-
Constructor Details
-
PercentageEvaluator
public PercentageEvaluator()
-
-
Method Details
-
absoluteTypedValue
- Overrides:
absoluteTypedValue
in classEvaluator
-
percentage
Obtain the float value (in the requested absolute unit) corresponding to the given percentage value.- Overrides:
percentage
in classEvaluator
- 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.
-