gpt4 book ai didi

com.sun.org.apache.xpath.internal.objects.XNumber类的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 12:00:40 26 4
gpt4 key购买 nike

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

XNumber介绍

[英]This class represents an XPath number, and is capable of converting the number to other types, such as a string.
[中]这个类表示一个XPath数字,并且能够将该数字转换为其他类型,例如字符串。

代码示例

代码示例来源:origin: org.freemarker/freemarker

return new SimpleNumber(Double.valueOf(((XNumber) xresult).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));
 }
}

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

/**
 * Construct a XNodeSet object.
 *
 * @param num Value of the object
 */
public XNumber(Number num)
{
 super();
 m_val = num.doubleValue();
 setObject(num);
}

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

textNodeValue = new XNumber(((Double) rtf).doubleValue()).str();

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

/**
 * Tell if two objects are functionally equal.
 *
 * @param obj2 Object to compare this to
 *
 * @return true if the two objects are equal 
 *
 * @throws javax.xml.transform.TransformerException
 */
public boolean equals(XObject obj2)
{
 // In order to handle the 'all' semantics of 
 // nodeset comparisons, we always call the 
 // nodeset function.
 int t = obj2.getType();
 try
 {
   if (t == XObject.CLASS_NODESET)
    return obj2.equals(this);
   else if(t == XObject.CLASS_BOOLEAN)
    return obj2.bool() == bool();
   else
     return m_val == obj2.num();
 }
 catch(javax.xml.transform.TransformerException te)
 {
  throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(te);
 }
}

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

+ zeros(exp - nDigits);
     + s.substring(2 + exp, e);
return sign + "0." + zeros(-1 - exp) + s.substring(0, 1)
    + s.substring(2, e);

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

textNodeValue = new XNumber(((Double) rtf).doubleValue()).str();

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

/**
 * Tell if two objects are functionally equal.
 *
 * @param obj2 Object to compare this to
 *
 * @return true if the two objects are equal 
 *
 * @throws javax.xml.transform.TransformerException
 */
public boolean equals(XObject obj2)
{
 // In order to handle the 'all' semantics of 
 // nodeset comparisons, we always call the 
 // nodeset function.
 int t = obj2.getType();
 try
 {
   if (t == XObject.CLASS_NODESET)
    return obj2.equals(this);
   else if(t == XObject.CLASS_BOOLEAN)
    return obj2.bool() == bool();
   else
     return m_val == obj2.num();
 }
 catch(javax.xml.transform.TransformerException te)
 {
  throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(te);
 }
}

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

+ zeros(exp - nDigits);
     + s.substring(2 + exp, e);
return sign + "0." + zeros(-1 - exp) + s.substring(0, 1)
    + s.substring(2, e);

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

/**
 * Get the score that this test will return if a test succeeds.
 *
 *
 * @return the score that this test will return if a test succeeds.
 */
public double getDefaultScore()
{
 return m_score.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
 {
     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

/**
 * Construct a XNodeSet object.
 *
 * @param num Value of the object
 */
public XNumber(Number num)
{
 super();
 m_val = num.doubleValue();
 setObject(num);
}

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

/**
 * Get the score that this test will return if a test succeeds.
 *
 *
 * @return the score that this test will return if a test succeeds.
 */
public double getDefaultScore()
{
 return m_score.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
{
 double pos = (double) getPositionInContextNodeList(xctxt);
 
 return new XNumber(pos);
}

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

/**
 * Return a java object that's closest to the representation
 * that should be handed to an extension.
 *
 * @return The value of this XNumber as a Double object
 */
public Object object()
{
 if(null == m_obj)
  setObject(new Double(m_val));
 return m_obj;
}

代码示例来源:origin: org.freemarker/com.springsource.freemarker

return new SimpleNumber(new Double(((XNumber) xresult).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
{
 double pos = (double) getPositionInContextNodeList(xctxt);
 
 return new XNumber(pos);
}

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

/**
 * Return a java object that's closest to the representation
 * that should be handed to an extension.
 *
 * @return The value of this XNumber as a Double object
 */
public Object object()
{
 if(null == m_obj)
  setObject(new Double(m_val));
 return m_obj;
}

代码示例来源:origin: org.freemarker/freemarker-gae

return new SimpleNumber(Double.valueOf(((XNumber) xresult).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(getArg0AsNumber(xctxt));
 }
}

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