com.sun.org.apache.xpath.internal.objects.XObject.num()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(138)

本文整理了Java中com.sun.org.apache.xpath.internal.objects.XObject.num()方法的一些代码示例,展示了XObject.num()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XObject.num()方法的具体详情如下:
包路径:com.sun.org.apache.xpath.internal.objects.XObject
类名称:XObject
方法名:num

XObject.num介绍

[英]Cast result object to a number. Always issues an error.
[中]将结果对象强制转换为数字。总是发出错误。

代码示例

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
 * 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();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

/**
 * 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();
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
 * 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());
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
 * 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());
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
  * 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()));
 }
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
 * 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());
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

/**
 * 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());
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

/**
 * 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());
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

/**
 * 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());
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
 * 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());
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

/**
 * 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();
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
 * 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();
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
 * 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());
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

/**
 * 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());
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
  * 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()));
 }
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
  * 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()));
 }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

/**
  * 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()));
 }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

/**
  * 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()));
 }
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
 * 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());
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
  * 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));
 }
}

相关文章