Package com.alimama.mdrill.ui.service.utils

Examples of com.alimama.mdrill.ui.service.utils.OperateType


    for (int j = 0; j < jsonStr.length(); j++) {
      JSONObject obj = jsonStr.getJSONObject(j);
      if (obj.has("thedate")) {
        JSONObject thedate = obj.getJSONObject("thedate");
        Integer operate = Integer.parseInt(thedate.get("operate").toString());
        OperateType optype=WebServiceParams.parseOperateType(operate);

        String[] val = WebServiceParams.parseFqValue(thedate.getString("value"), operate).split(",");
        if (optype.equals(OperateType.eq)||optype.equals(OperateType.in))
        {
          for (String day : val) {
            Date d = fmt.parse(day.replaceAll("-", ""));
            String[] partions = get(d.getTime(), d.getTime(), parttype);
            for (String partion : partions) {
              rtn.add(partion);
              isset = true;
            }
          }
        }
        if (optype.equals(OperateType.range))// =,range
        {
          Long min = Long.MAX_VALUE;
          Long max = Long.MIN_VALUE;
          for (String day : val) {
            Date d = fmt.parse(day.replaceAll("-", ""));
            Long time = d.getTime();
            max = Math.max(max, time);
            min = Math.min(min, time);
            isset = true;
          }
          String[] partions = get(min, max, parttype);
          for (String partion : partions) {
            rtn.add(partion);
          }
          break;

        }

        if (optype.equals(OperateType.gt)||optype.equals(OperateType.gteq))
        {
          for (String day : val) {
            Date d = fmt.parse(day.replaceAll("-", ""));
            Long time = d.getTime() + (operate == 3 ? 0 : 1);
            small = small > 0 ? Math.min(small, time) : time;
          }
        }

        if (optype.equals(OperateType.lg)||optype.equals(OperateType.lgeq))
        {
          for (String day : val) {
            Date d = fmt.parse(day.replaceAll("-", ""));
            Long time = d.getTime() - (operate == 4 ? 0 : 1);
            bigger = bigger > 0 ? Math.max(bigger, time) : time;
View Full Code Here


    for (int j = 0; j < jsonStr.length(); j++) {
      JSONObject obj = jsonStr.getJSONObject(j);
      if (obj.has(this.fieldname)) {
        JSONObject thedate = obj.getJSONObject(this.fieldname);
        Integer operate = Integer.parseInt(thedate.get("operate").toString());
        OperateType optype=WebServiceParams.parseOperateType(operate);
        String[] val = WebServiceParams.parseFqValue(thedate.getString("value"), operate).split(",");
        if (optype.equals(OperateType.eq)||optype.equals(OperateType.in))
        {
          for (String dir : val) {
            rtn.add(dir);
          }
View Full Code Here

TOP

Related Classes of com.alimama.mdrill.ui.service.utils.OperateType

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.