Package org.apache.xpath.objects

Examples of org.apache.xpath.objects.XNumber


        error(XPATHErrorResources.ER_COULDNOT_BE_FORMATTED_TO_NUMBER,
              new Object[]{ m_token })//m_token+" could not be formatted to a number!");
      }

      m_ops.m_tokenQueue.setElementAt(new XNumber(num),m_queueMark - 1);
      m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1);
      m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);

      nextToken();
    }
View Full Code Here


    {
      String[] edz = getEraDatetimeZone(datetimeIn);
      boolean ad = edz[0].length() == 0; // AD (Common Era -- empty leader)
      String datetime = edz[1];
      if (datetime == null)
        return new XNumber(Double.NaN);
     
      String[] formats = {dt, d, gym, gy};
      double yr = getNumber(datetime, formats, Calendar.YEAR);
      if (ad || yr == Double.NaN)
        return new XNumber(yr);
      else
        return new XNumber(-yr);
    }
View Full Code Here

     * See above.
     */
    public static XNumber year()
    {
      Calendar cal = Calendar.getInstance();
      return new XNumber(cal.get(Calendar.YEAR));
    }
View Full Code Here

      throws ParseException
    {
      String[] edz = getEraDatetimeZone(datetimeIn);
      String datetime = edz[1];
      if (datetime == null)
        return new XNumber(Double.NaN);     
     
      String[] formats = {dt, d, gym};
      return new XNumber(getNumber(datetime, formats, Calendar.MONTH));
    }
View Full Code Here

     * See above.
     */
    public static XNumber monthInYear()
    {     
      Calendar cal = Calendar.getInstance();
      return new XNumber(cal.get(Calendar.MONTH));
   }
View Full Code Here

      throws ParseException
    {
      String[] edz = getEraDatetimeZone(datetimeIn);
      String datetime = edz[1];
      if (datetime == null)
        return new XNumber(Double.NaN);     
     
      String[] formats = {dt, d};
      return new XNumber(getNumber(datetime, formats, Calendar.WEEK_OF_YEAR));
    }
View Full Code Here

     * See above.
     */
    public static XNumber weekInYear()
    {
       Calendar cal = Calendar.getInstance();
      return new XNumber(cal.get(Calendar.WEEK_OF_YEAR));
   }
View Full Code Here

      throws ParseException
    {
      String[] edz = getEraDatetimeZone(datetimeIn);
      String datetime = edz[1];
      if (datetime == null)
        return new XNumber(Double.NaN);           
     
      String[] formats = {dt, d};
      return new XNumber(getNumber(datetime, formats, Calendar.DAY_OF_YEAR));
    }
View Full Code Here

     * See above.
     */
    public static XNumber dayInYear()
    {
       Calendar cal = Calendar.getInstance();
      return new XNumber(cal.get(Calendar.DAY_OF_YEAR));
   }
View Full Code Here

    {
      String[] edz = getEraDatetimeZone(datetimeIn);
      String datetime = edz[1];
      String[] formats = {dt, d, gmd, gd};
      double day = getNumber(datetime, formats, Calendar.DAY_OF_MONTH);
      return new XNumber(day);
    }
View Full Code Here

TOP

Related Classes of org.apache.xpath.objects.XNumber

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.