String tmp = logic;
if (logic.length() == 0 || logic.equalsIgnoreCase("or")) {
logic = "";
Iterator i = listOfEventGroups.iterator();
while (i.hasNext()) {
SOSEventGroups evg = (SOSEventGroups) i.next();
logic += evg.group + " or ";
}
logic += " false";
}
if (logic.equalsIgnoreCase("and")) {
logic = "";
Iterator i = listOfEventGroups.iterator();
while (i.hasNext()) {
SOSEventGroups evg = (SOSEventGroups) i.next();
logic += evg.group + " and ";
}
logic += " true";
}
BooleanExp exp = new BooleanExp(logic);
Iterator i = listOfEventGroups.iterator();
while (i.hasNext()) {
SOSEventGroups evg = ( SOSEventGroups) i.next();
exp.replace(evg.group, exp.trueFalse(evg.isActiv(listOfActiveEvents)));
}
logic = tmp;
return exp.evaluateExpression();
}