for (Event firstEvent : getEventDao().getAll()) {
for (Event secEvent : getEventDao().getAll()) {
int i = Integer.parseInt(bReader.readLine());
if (i == 1) {
// add the constraint to the both event
EventOrderConstraint firstConstraint = firstEvent.getConstraint(EventOrderConstraint.class);
if (firstConstraint == null) {
firstConstraint = new EventOrderConstraint(firstEvent);
firstEvent.putConstraint(firstConstraint);
}
firstConstraint.addFollow(secEvent);
EventOrderConstraint secConstraint = secEvent.getConstraint(EventOrderConstraint.class);
if (secConstraint == null) {
secConstraint = new EventOrderConstraint(secEvent);
secEvent.putConstraint(secConstraint);
}
secConstraint.addBefore(firstEvent);
} else if (i == -1) {
// We could check now the priviously added followers and beforers,
// but this is not possible because '-1' could occur the
// first time (instead of expected '1')
}