private ArrayList<ConstraintImpl> getAllAndConditions() { ArrayList<ConstraintImpl> list = new ArrayList<ConstraintImpl>(); for(ConstraintImpl c : constraints) { if (c instanceof AndImpl) { list.addAll(((AndImpl) c).getAllAndConditions()); } else { list.add(c); } } return list; }
private ArrayList<ConstraintImpl> getAllAndConditions() { ArrayList<ConstraintImpl> list = new ArrayList<ConstraintImpl>(); for(ConstraintImpl c : constraints) { if (c instanceof AndImpl) { list.addAll(((AndImpl) c).getAllAndConditions()); } else { list.add(c); } } return list; }
private ArrayList<ConstraintImpl> getAllAndConditions() { ArrayList<ConstraintImpl> list = new ArrayList<ConstraintImpl>(); for(ConstraintImpl c : constraints) { if (c instanceof AndImpl) { list.addAll(((AndImpl) c).getAllAndConditions()); } else { list.add(c); } } return list; }
public AndImpl pullOrRight() { if (getLastConstraint() instanceof OrImpl) { return this; } ArrayList<ConstraintImpl> andList = getAllAndConditions(); for (int i = 0; i < andList.size() - 1; i++) { ConstraintImpl c = andList.get(i); if (c instanceof OrImpl) { ArrayList<ConstraintImpl> list = new ArrayList<ConstraintImpl>(); list.addAll(andList); list.remove(i); list.add(c); return new AndImpl(list); } } return this; }
public AndImpl pullOrRight() { if (getLastConstraint() instanceof OrImpl) { return this; } ArrayList<ConstraintImpl> andList = getAllAndConditions(); for (int i = 0; i < andList.size() - 1; i++) { ConstraintImpl c = andList.get(i); if (c instanceof OrImpl) { ArrayList<ConstraintImpl> list = new ArrayList<ConstraintImpl>(); list.addAll(andList); list.remove(i); list.add(c); return new AndImpl(list); } } return this; }
public AndImpl pullOrRight() { if (getLastConstraint() instanceof OrImpl) { return this; } ArrayList<ConstraintImpl> andList = getAllAndConditions(); for (int i = 0; i < andList.size() - 1; i++) { ConstraintImpl c = andList.get(i); if (c instanceof OrImpl) { ArrayList<ConstraintImpl> list = new ArrayList<ConstraintImpl>(); list.addAll(andList); list.remove(i); list.add(c); return new AndImpl(list); } } return this; }