gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-18 11:52:40 29 4
gpt4 key购买 nike

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

XNumber.<init>介绍

[英]Construct a XNodeSet object.
[中]构造一个XNodeSet对象。

代码示例

代码示例来源: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));
 }
}

代码示例来源: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
{
 double pos = (double) getPositionInContextNodeList(xctxt);
 
 return new XNumber(pos);
}

代码示例来源: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
{
 XNumber xnum = new XNumber((double) getCountOfContextNodeList(xctxt));
 // System.out.println("last: "+xnum.num());
 return xnum;
}

代码示例来源: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
{
 double pos = (double) getPositionInContextNodeList(xctxt);
 
 return new XNumber(pos);
}

代码示例来源: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(getArg0AsNumber(xctxt));
 }
}

代码示例来源: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(getArg0AsNumber(xctxt));
 }
}

代码示例来源: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
{
 XNumber xnum = new XNumber((double) getCountOfContextNodeList(xctxt));
 // System.out.println("last: "+xnum.num());
 return xnum;
}

代码示例来源: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: 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(getArg0AsString(xctxt).length());
 }
}

代码示例来源: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(getArg0AsString(xctxt).length());
 }
}

代码示例来源: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 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

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

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com