Package abstrasy

Examples of abstrasy.Node$ParseBag


  }
   
  public Node external_time_string(Node startAt) throws Exception {
        startAt.isGoodArgsCnt(1);
    SimpleDateFormat sdf = new SimpleDateFormat(this.time_default_format);
    return new Node(sdf.format(date));
  }
View Full Code Here


  public Node external_string(Node startAt) throws Exception {
        startAt.isGoodArgsCnt(1);
    SimpleDateFormat sdf1 = new SimpleDateFormat(this.date_default_format);
    SimpleDateFormat sdf2 = new SimpleDateFormat(this.time_default_format);
    return new Node(sdf1.format(date) + " " + sdf2.format(date));
  }
View Full Code Here

    return new Node(sdf1.format(date) + " " + sdf2.format(date));
  }

  public Node external_number(Node startAt) throws Exception {
        startAt.isGoodArgsCnt(1);
    return new Node(date.getTime());
  }
View Full Code Here


  public Node external_mutator_set_DateFormat(Node startAt) throws Exception {
        startAt.isGoodArgsCnt(2);
        SELF.require_SELF_mutable();
        Node anode = startAt.getSubNode(1, Node.TYPE_STRING);
    date_default_format = anode.getString();
    return null;
  }
View Full Code Here

  }

  public Node external_mutator_set_TimeFormat(Node startAt) throws Exception {
        startAt.isGoodArgsCnt(2);
        SELF.require_SELF_mutable();
        Node anode = startAt.getSubNode(1, Node.TYPE_STRING);
    time_default_format = anode.getString();
    return null;
  }
View Full Code Here

        }
        SimpleDateFormat sdf = locale==null ? new SimpleDateFormat(format) : new SimpleDateFormat(format,locale);
        if(startAt.size()==4){
            sdf.setTimeZone(TimeZone.getTimeZone(startAt.getSubNode(3, Node.TYPE_STRING).getString()));
        }
    return new Node(sdf.format(date));
  }
View Full Code Here

  }

  public Node external_mutator_parse_date(Node startAt) throws Exception {
    startAt.isGoodArgsLength(true, 2);
        SELF.require_SELF_mutable();
        Node anode = startAt.getSubNode(1, Node.TYPE_STRING);
    SimpleDateFormat sdf = new SimpleDateFormat(this.date_default_format);
    date = sdf.parse(anode.getString());
    return null;
  }
View Full Code Here

  }

  public Node external_mutator_parse_time(Node startAt) throws Exception {
    startAt.isGoodArgsLength(true, 2);
        SELF.require_SELF_mutable();
        Node anode = startAt.getSubNode(1, Node.TYPE_STRING);
    SimpleDateFormat sdf = new SimpleDateFormat(this.time_default_format);
    date = sdf.parse(anode.getString());
    return null;
  }
View Full Code Here

  }

  public Node external_mutator_add_delta(Node startAt) throws Exception {
    startAt.isGoodArgsLength(true, 2);
        SELF.require_SELF_mutable();
        Node anode = startAt.getSubNode(1, Node.TYPE_HASH | Node.TYPE_NUMBER);
    if (anode.getQType()==Node.TYPE_NUMBER) {
      date.setTime(date.getTime() + (long) anode.getNumber());
    }
    else {
            // hash
            Hash hash = anode.getHash();
      Calendar c = Calendar.getInstance();
      c.setTime(date);
            Node tmp;
      tmp = getNumPairValue(hash, new Node(K_HOUR));
      if (tmp != null) {
        c.add(Calendar.HOUR, (int) tmp.getNumber());
      }
      tmp = getNumPairValue(hash, new Node(K_MINUTE));
      if (tmp != null) {
        c.add(Calendar.MINUTE, (int) tmp.getNumber());
      }
      tmp = getNumPairValue(hash, new Node(K_SECOND));
      if (tmp != null) {
        c.add(Calendar.SECOND, (int) tmp.getNumber());
      }
      tmp = getNumPairValue(hash, new Node(K_MILLIS));
      if (tmp != null) {
        c.add(Calendar.MILLISECOND, (int) tmp.getNumber());
      }
      tmp = getNumPairValue(hash, new Node(K_YEAR));
      if (tmp != null) {
        c.add(Calendar.YEAR, (int) tmp.getNumber());
      }
      tmp = getNumPairValue(hash, new Node(K_MONTH));
      if (tmp != null) {
        c.add(Calendar.MONTH, (int) tmp.getNumber());
      }
      tmp = getNumPairValue(hash, new Node(K_DAY));
      if (tmp != null) {
        c.add(Calendar.DATE, (int) tmp.getNumber());
      }
      date = c.getTime();
    }
    return null;
  }
View Full Code Here

        return SELF.get(); // retourner une référence de l'objet courrant...
    }

  public Node external_quote(Node startAt) throws Exception {
    startAt.isGoodArgsCnt(1,2);
        return abstrasy.externals.AExtTools.SerializationTK.createInitExpr(Node.createPattern(External_Date.class.getName()), new Node(date.getTime()),
                new Node(this.date_default_format), new Node(this.time_default_format));
  }
View Full Code Here

TOP

Related Classes of abstrasy.Node$ParseBag

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.