Package org.htmlunit.xpath.operations
Class Plus
- java.lang.Object
-
- org.htmlunit.xpath.Expression
-
- org.htmlunit.xpath.operations.Operation
-
- org.htmlunit.xpath.operations.Plus
-
- All Implemented Interfaces:
javax.xml.transform.SourceLocator
,ExpressionNode
,XPathVisitable
public class Plus extends Operation
The '+' operation expression executer.
-
-
Constructor Summary
Constructors Constructor Description Plus()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
num(XPathContext xctxt)
Evaluate expression to a number.XObject
operate(XObject left, XObject right)
Apply the operation to two operands, and return the result.-
Methods inherited from class org.htmlunit.xpath.operations.Operation
callVisitors, canTraverseOutsideSubtree, deepEquals, execute, setLeftRight
-
Methods inherited from class org.htmlunit.xpath.Expression
asIterator, asNode, assertion, bool, error, execute, execute, execute, exprGetParent, exprSetParent, getColumnNumber, getExpressionOwner, getLineNumber, getPublicId, getSystemId, isSameClass, isStableNumber
-
-
-
-
Method Detail
-
operate
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException
Apply the operation to two operands, and return the result.- Overrides:
operate
in classOperation
- Parameters:
left
- non-null reference to the evaluated left operand.right
- non-null reference to the evaluated right operand.- Returns:
- non-null reference to the XObject that represents the result of the operation.
- Throws:
javax.xml.transform.TransformerException
- in case of error
-
num
public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException
Evaluate expression to a number.- Overrides:
num
in classExpression
- Parameters:
xctxt
- The XPath runtime context.- Returns:
- The expression evaluated as a double.
- Throws:
javax.xml.transform.TransformerException
- if any
-
-