private boolean forEachConstraintRecursively(Function4 block) { Queue4 queue = new NoDuplicatesQueue(new NonblockingQueue()); Iterator4 constrIter = iterateConstraints(); while (constrIter.moveNext()) { queue.add(constrIter.current()); } while (queue.hasNext()) { QCon constr = (QCon) queue.next(); Boolean cancel = (Boolean) block.apply(constr); if (cancel.booleanValue()) { return true; } Iterator4 childIter = constr.iterateChildren(); while (childIter.moveNext()) { queue.add(childIter.current()); } Iterator4 joinIter = constr.iterateJoins(); while (joinIter.moveNext()) { queue.add(joinIter.current()); } } return false; }
public int nextId() { return ((Integer) _queue.next()).intValue(); }