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
@Beta public abstract class AbstractYangXPathMathSupport<N extends YangNumberExpr> extends Object implements YangXPathMathSupport
Type-safe shim to ensure concreteYangXPathMathSupport
implementations get handed properly-typed YangNumberExprs.- Author:
- Robert Varga
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractYangXPathMathSupport(Class<N> numberClass)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected 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.N
negateNumber(YangNumberExpr number)
Create aYangNumberExpr
representing the negated value of a number.protected abstract Object
readResolve()
Optional<YangExpr>
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
-
-
-
-
Method Detail
-
negateNumber
public final N negateNumber(YangNumberExpr number)
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
protected abstract N doNegateNumber(N number)
Create aYangNumberExpr
representing the negated value of a number.- Parameters:
number
- input number- Returns:
- negated number expression
-
doEvaluate
protected abstract YangExpr doEvaluate(YangBinaryOperator operator, N left, N right)
Evaluate an operator and its left- and right-handside.- Parameters:
operator
- Operator to applyleft
- Left hand-sideright
- Right hand-side- Returns:
- Evaluation result
-
readResolve
protected abstract Object readResolve()
-
-