java.lang.Object
org.jhotdraw8.css.function.AbstractCssFunction<T>
org.jhotdraw8.css.function.AbstractMathCssFunction<T>
- Type Parameters:
T- the element type of the DOM
- All Implemented Interfaces:
CssFunction<T>
- Direct Known Subclasses:
CalcCssFunction
Provides protected methods for processing the following productions:
calc-sum = calc-product , { [ '+' | '-' ] , calc-product } ;
calc-product = calc-value , { '*' , calc-value | '/' , calc-number-value } ;
calc-value = number | dimension | percentage | '(' , calc-sum , ')' ;
calc-number-sum = calc-number-product , { [ '+' | '-' ] calc-number-product } ;
calc-number-product = calc-number-value> , { '*' , calc-number-value | '/' , calc-number-value } ;
calc-number-value = number | calc-number-sum ;
In addition, white space is required on both sides of the '+' and '-' operators.
(The '*' and '/' operaters can be used without white space around them.)
References:
- CSS Values and Units Module Level 4. Paragraph 10.8. Syntax
- csswg.org
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable CssSizeparseCalcProduct(T element, CssTokenizer tt, CssFunctionProcessor<T> functionProcessor) protected @Nullable CssSizeparseCalcSum(T element, CssTokenizer tt, CssFunctionProcessor<T> functionProcessor) protected @Nullable CssSizeparseCalcValue(T element, CssTokenizer tt, CssFunctionProcessor<T> functionProcessor) protected voidproduceNumberPercentageOrDimension(Consumer<CssToken> out, CssSize dim, int line, int start, int end) Methods inherited from class org.jhotdraw8.css.function.AbstractCssFunction
getNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jhotdraw8.css.function.CssFunction
getHelpText, process
-
Constructor Details
-
AbstractMathCssFunction
-
-
Method Details
-
parseCalcSum
protected @Nullable CssSize parseCalcSum(T element, CssTokenizer tt, CssFunctionProcessor<T> functionProcessor) throws IOException, ParseException - Throws:
IOExceptionParseException
-
parseCalcProduct
protected @Nullable CssSize parseCalcProduct(T element, CssTokenizer tt, CssFunctionProcessor<T> functionProcessor) throws IOException, ParseException - Throws:
IOExceptionParseException
-
produceNumberPercentageOrDimension
-
parseCalcValue
protected @Nullable CssSize parseCalcValue(T element, CssTokenizer tt, CssFunctionProcessor<T> functionProcessor) throws IOException, ParseException - Throws:
IOExceptionParseException
-