/** * Cast result object to a number, but allow side effects, such as the * incrementing of an iterator. * * @return numeric value of the string conversion from the * next node in the NodeSetDTM, or NAN if no node was found */ public double numWithSideEffects() throws javax.xml.transform.TransformerException { return num(); }
/** * Cast result object to a number, but allow side effects, such as the * incrementing of an iterator. * * @return numeric value of the string conversion from the * next node in the NodeSetDTM, or NAN if no node was found */ public double numWithSideEffects() throws javax.xml.transform.TransformerException { return num(); }
/** * Apply the operation to two operands, and return the result. * * * @param left non-null reference to the evaluated left operand. * @param right non-null reference to the evaluated right operand. * * @return non-null reference to the XObject that represents the result of the operation. * * @throws javax.xml.transform.TransformerException */ public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return new XNumber(left.num() * right.num()); }
/** * Apply the operation to two operands, and return the result. * * * @param left non-null reference to the evaluated left operand. * @param right non-null reference to the evaluated right operand. * * @return non-null reference to the XObject that represents the result of the operation. * * @throws javax.xml.transform.TransformerException */ public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return new XNumber(left.num() % right.num()); }
/** * Apply the operation to two operands, and return the result. * * * @param left non-null reference to the evaluated left operand. * @param right non-null reference to the evaluated right operand. * * @return non-null reference to the XObject that represents the result of the operation. * * @throws javax.xml.transform.TransformerException */ public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return new XNumber(left.num() + right.num()); }
/** * Apply the operation to two operands, and return the result. * * * @param left non-null reference to the evaluated left operand. * @param right non-null reference to the evaluated right operand. * * @return non-null reference to the XObject that represents the result of the operation. * * @throws javax.xml.transform.TransformerException */ public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return new XNumber(left.num() / right.num()); }
/** * Apply the operation to two operands, and return the result. * * * @param left non-null reference to the evaluated left operand. * @param right non-null reference to the evaluated right operand. * * @return non-null reference to the XObject that represents the result of the operation. * * @throws javax.xml.transform.TransformerException */ public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return new XNumber((int) (left.num() / right.num())); } }
/** * Apply the operation to two operands, and return the result. * * * @param left non-null reference to the evaluated left operand. * @param right non-null reference to the evaluated right operand. * * @return non-null reference to the XObject that represents the * result of the operation. * * @throws javax.xml.transform.TransformerException */ public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return new XNumber(left.num() - right.num()); }
/** * Apply the operation to two operands, and return the result. * * * @param left non-null reference to the evaluated left operand. * @param right non-null reference to the evaluated right operand. * * @return non-null reference to the XObject that represents the result of the operation. * * @throws javax.xml.transform.TransformerException */ public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return new XNumber(left.num() * right.num()); }
/** * Apply the operation to two operands, and return the result. * * * @param left non-null reference to the evaluated left operand. * @param right non-null reference to the evaluated right operand. * * @return non-null reference to the XObject that represents the result of the operation. * * @throws javax.xml.transform.TransformerException */ public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return new XNumber(left.num() / right.num()); }
/** * Apply the operation to two operands, and return the result. * * * @param right non-null reference to the evaluated right operand. * * @return non-null reference to the XObject that represents the result of the operation. * * @throws javax.xml.transform.TransformerException */ public XObject operate(XObject right) throws javax.xml.transform.TransformerException { return new XNumber(-right.num()); }
/** * Evaluate expression to a number. * * * @param xctxt The XPath runtime context. * @return The expression evaluated as a double. * * @throws javax.xml.transform.TransformerException */ public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException { return execute(xctxt).num(); }
/** * Apply the operation to two operands, and return the result. * * * @param right non-null reference to the evaluated right operand. * * @return non-null reference to the XObject that represents the result of the operation. * * @throws javax.xml.transform.TransformerException */ public XObject operate(XObject right) throws javax.xml.transform.TransformerException { return new XNumber(-right.num()); }
/** * Evaluate expression to a number. * * * @param xctxt The XPath runtime context. * @return The expression evaluated as a double. * * @throws javax.xml.transform.TransformerException */ public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException { return execute(xctxt).num(); }
/** * Execute the function. The function must return * a valid object. * @param xctxt The current execution context. * @return A valid XObject. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return new XNumber(java.lang.Math.floor(m_arg0.execute(xctxt).num())); } }
/** * Execute the function. The function must return * a valid object. * @param xctxt The current execution context. * @return A valid XObject. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return new XNumber(Math.ceil(m_arg0.execute(xctxt).num())); } }
/** * Execute the function. The function must return * a valid object. * @param xctxt The current execution context. * @return A valid XObject. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return new XNumber(Math.ceil(m_arg0.execute(xctxt).num())); } }
/** * Execute the function. The function must return * a valid object. * @param xctxt The current execution context. * @return A valid XObject. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return new XNumber(java.lang.Math.floor(m_arg0.execute(xctxt).num())); } }
/** * Apply the operation to two operands, and return the result. * * * @param right non-null reference to the evaluated right operand. * * @return non-null reference to the XObject that represents the result of the operation. * * @throws javax.xml.transform.TransformerException */ public XObject operate(XObject right) throws javax.xml.transform.TransformerException { if (XObject.CLASS_NUMBER == right.getType()) return right; else return new XNumber(right.num()); }
/** * Execute the function. The function must return * a valid object. * @param xctxt The current execution context. * @return A valid XObject. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { final XObject obj = m_arg0.execute(xctxt); final double val= obj.num(); if (val >= -0.5 && val < 0) return new XNumber(-0.0); if (val == 0.0) return new XNumber(val); return new XNumber(java.lang.Math.floor(val + 0.5)); } }