示例#1
0
  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;
  }
示例#2
0
 public int nextId() {
   return ((Integer) _queue.next()).intValue();
 }
示例#3
0
 public boolean hasMoreIds() {
   return _queue.hasNext();
 }