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 Test transmogrify(Function4<Test, Test> fun) { return fun.apply(this); }