Package org.jamesii.model.carules.reader.antlr.parser

Examples of org.jamesii.model.carules.reader.antlr.parser.StateCondition


      }
      return result.toString();
    }

    if (condition instanceof StateCondition) {
      StateCondition cond = ((StateCondition) condition);
      if (cond.getMin() == cond.getMax() && cond.getMax() == 1) {
        result = new StringBuilder();
      } else if (cond.getMin() == cond.getMax()) {
        result = new StringBuilder("{" + cond.getMin() + "}");
      } else if (cond.getMax() == Integer.MAX_VALUE) {
        result = new StringBuilder("{" + cond.getMin() + ",}");
      } else if (cond.getMin() <= 0) {
        result = new StringBuilder("{," + cond.getMax() + "}");
      } else {
        result =
            new StringBuilder("{" + cond.getMin() + "," + cond.getMax() + "}");
      }
      return info.getStates().get(cond.getState()) + result;
    }

    if (condition instanceof NotCondition) {
      NotCondition cond = (NotCondition) condition;
      result.append("!" + conditionToString(cond.getCondition(), info));
    }

    String tempResult = "";

    String concat = "";
View Full Code Here


    AndExpression a = new AndExpression(new BooleanCondition(true));
    List<String> states = Arrays.asList(allStates);
    for (Entry<String, Integer> e : map.entrySet()) {
      int i = states.indexOf(e.getKey());
      a.addCondition(new StateCondition(i, e.getValue(), e.getValue()));
    }

    return new CARule(new CurrentStateCondition(states.indexOf(currentState)),
        a, states.indexOf(targetState), 1d);
  }
View Full Code Here

    AndExpression a = new AndExpression(new BooleanCondition(true));
    List<String> states = Arrays.asList(allStates);
    for (Entry<String, Integer> e : map.entrySet()) {
      int i = states.indexOf(e.getKey());
      a.addCondition(new StateCondition(i, e.getValue(), e.getValue()));
    }

    return new CARule(new CurrentStateCondition(states.indexOf(currentState)),
        a, states.indexOf(targetState), 1d);
  }
View Full Code Here

TOP

Related Classes of org.jamesii.model.carules.reader.antlr.parser.StateCondition

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.