Examples of HZincReader


Examples of org.haystack.io.HZincReader

     * requests failed, then raise CallErrException for first failure.
     */
    public HGrid[] evalAll(HGrid req, boolean checked) {
        String reqStr = HZincWriter.gridToString(req);
        String resStr = postString("evalAll", reqStr);
        HGrid[] res = new HZincReader(resStr).readGrids();
        if (checked) {
            for (int i = 0; i < res.length; ++i)
                if (res[i].isErr())
                    throw new CallErrException(res[i]);
        }
View Full Code Here

Examples of org.haystack.io.HZincReader

    }

    private HGrid postGrid(String op, HGrid req) {
        String reqStr = HZincWriter.gridToString(req);
        String resStr = postString(op, reqStr);
        return new HZincReader(resStr).readGrid();
    }
View Full Code Here

Examples of org.haystack.io.HZincReader

            String name = entry.getKey();
            String valStr = entry.getValue()[0];

            HVal val;
            try {
                val = new HZincReader(valStr).readScalar();
            }
            catch (Exception e) {
                val = HStr.make(valStr);
            }
            b.add(name, val);
View Full Code Here

Examples of org.haystack.io.HZincReader

        return new HDate(c.get(Calendar.YEAR), c.get(Calendar.MONTH) + 1, c.get(Calendar.DAY_OF_MONTH));
    }

    /** Parse from string fomat "YYYY-MM-DD" or raise ParseException */
    public static HDate make(String s) {
        HVal val = new HZincReader(s).readScalar();
        if (val instanceof HDate)
            return (HDate) val;
        throw new ParseException(s);
    }
View Full Code Here

Examples of org.projecthaystack.io.HZincReader

  }

  /** Parse from string fomat "YYYY-MM-DD" or raise ParseException */
  public static HDate make(String s)
  {
    HVal val = new HZincReader(s).readScalar();
    if (val instanceof HDate) return (HDate)val;
    throw new ParseException(s);
  }
View Full Code Here

Examples of org.projecthaystack.io.HZincReader

    // parse scalars
    int comma = str.indexOf(',');
    HVal start = null, end = null;
    if (comma < 0)
    {
      start = new HZincReader(str).readScalar();
    }
    else
    {
      start = new HZincReader(str.substring(0, comma)).readScalar();
      end   = new HZincReader(str.substring(comma+1)).readScalar();
    }

    // figure out what we parsed for start,end
    if (start instanceof HDate)
    {
View Full Code Here

Examples of org.projecthaystack.io.HZincReader

  }

  /** Parse from string fomat "YYYY-MM-DD" or raise ParseException */
  public static HDate make(String s)
  {
    HVal val = new HZincReader(s).readScalar();
    if (val instanceof HDate) return (HDate)val;
    throw new ParseException(s);
  }
View Full Code Here

Examples of org.projecthaystack.io.HZincReader

    // parse scalars
    int comma = str.indexOf(',');
    HVal start = null, end = null;
    if (comma < 0)
    {
      start = new HZincReader(str).readScalar();
    }
    else
    {
      start = new HZincReader(str.substring(0, comma)).readScalar();
      end   = new HZincReader(str.substring(comma+1)).readScalar();
    }

    // figure out what we parsed for start,end
    if (start instanceof HDate)
    {
View Full Code Here

Examples of org.projecthaystack.io.HZincReader

  }

  /** Parse from string fomat "hh:mm:ss.FF" or raise ParseException */
  public static HTime make(String s)
  {
    HVal val = new HZincReader(s).readScalar();
    if (val instanceof HTime) return (HTime)val;
    throw new ParseException(s);
  }
View Full Code Here

Examples of org.projecthaystack.io.HZincReader

      ParseException if not formatted correctly */
  public static HFilter make(String s, boolean checked)
  {
    try
    {
      return new HZincReader(s).readFilter();
    }
    catch (Exception e)
    {
      if (!checked) return null;
      if (e instanceof ParseException) throw (ParseException)e;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.