Class AbstractYangXPathMathSupport<N extends YangNumberExpr>
java.lang.Object
org.opendaylight.yangtools.yang.xpath.api.AbstractYangXPathMathSupport<N>
- Type Parameters:
N
- Type of YangNumberExpr
- All Implemented Interfaces:
Serializable
,YangXPathMathSupport
public abstract class AbstractYangXPathMathSupport<N extends YangNumberExpr>
extends Object
implements YangXPathMathSupport
Type-safe shim to ensure concrete
YangXPathMathSupport
implementations get handed properly-typed
YangNumberExprs.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract YangExpr
doEvaluate
(YangBinaryOperator operator, N left, N right) Evaluate an operator and its left- and right-handside.protected abstract N
doNegateNumber
(N number) Create aYangNumberExpr
representing the negated value of a number.final N
negateNumber
(YangNumberExpr number) Create aYangNumberExpr
representing the negated value of a number.protected abstract Object
tryEvaluate
(YangBinaryOperator operator, YangNumberExpr left, YangNumberExpr right) Attempt to evaluate an operator and its left- and right-handside.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opendaylight.yangtools.yang.xpath.api.YangXPathMathSupport
createNumber, createNumber
-
Constructor Details
-
AbstractYangXPathMathSupport
-
-
Method Details
-
negateNumber
Description copied from interface:YangXPathMathSupport
Create aYangNumberExpr
representing the negated value of a number.- Specified by:
negateNumber
in interfaceYangXPathMathSupport
- Parameters:
number
- input number- Returns:
- negated number expression
-
tryEvaluate
public final Optional<YangExpr> tryEvaluate(YangBinaryOperator operator, YangNumberExpr left, YangNumberExpr right) Description copied from interface:YangXPathMathSupport
Attempt to evaluate an operator and its left- and right-handside.- Specified by:
tryEvaluate
in interfaceYangXPathMathSupport
- Parameters:
operator
- Operator to applyleft
- Left hand-sideright
- Right hand-side- Returns:
- Evaluation result, if evaluation succeeded
-
doNegateNumber
Create aYangNumberExpr
representing the negated value of a number.- Parameters:
number
- input number- Returns:
- negated number expression
-
doEvaluate
Evaluate an operator and its left- and right-handside.- Parameters:
operator
- Operator to applyleft
- Left hand-sideright
- Right hand-side- Returns:
- Evaluation result
-
readResolve
-