org.apache.xpath.operations

## Class Number

- java.lang.Object
- - org.apache.xpath.Expression
  - - org.apache.xpath.operations.UnaryOperation
    - - org.apache.xpath.operations.Number

- All Implemented Interfaces:
    java.io.Serializable, javax.xml.transform.SourceLocator, ExpressionNode, ExpressionOwner, XPathVisitable

      public class Number
      extends UnaryOperation

  The 'number()' operation expression executer.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Number()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `num(XPathContext xctxt)` Evaluate this operation directly to a double.
    `XObject` | `operate(XObject right)` Apply the operation to two operands, and return the result.

    - ### Methods inherited from class org.apache.xpath.operations.UnaryOperation

      `callVisitors, canTraverseOutsideSubtree, deepEquals, execute, fixupVariables, getExpression, getOperand, setExpression, setRight`

    - ### Methods inherited from class org.apache.xpath.Expression

      `asIterator, asIteratorRaw, asNode, assertion, bool, error, execute, execute, execute, executeCharsToContentHandler, exprAddChild, exprGetChild, exprGetNumChildren, exprGetParent, exprSetParent, getColumnNumber, getExpressionOwner, getLineNumber, getPublicId, getSystemId, isNodesetExpr, isStableNumber, warn, xstr`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Number

          public Number()

  - ### Method Detail

    - #### operate

          public XObject operate(XObject right)
                          throws javax.xml.transform.TransformerException

      Apply the operation to two operands, and return the result.
      Specified by:
        `operate` in class `UnaryOperation`
      Parameters:
        `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`

    - #### num

          public double num(XPathContext xctxt)
                     throws javax.xml.transform.TransformerException

      Evaluate this operation directly to a double.
      Overrides:
        `num` in class `Expression`
      Parameters:
        `xctxt` - The runtime execution context.
      Returns:
        The result of the operation as a double.
      Throws:
        `javax.xml.transform.TransformerException`

Copyright © 2023 Apache XML Project. All Rights Reserved.