Пример #1
0
 public Instance next() {
   Instance input = source.peekNext();
   for (int i = 0; i < pipes.size(); i++) {
     if (pipes.get(i).precondition(input)) {
       return iterators.get(i).next();
     }
   }
   throw new IllegalStateException(
       "Next Instance satisfied none of the branches' preconditions.");
 }
Пример #2
0
 public boolean hasNext() {
   return source.hasNext() && testingPipe.precondition(source.peekNext());
 }
Пример #3
0
 public Instance next() {
   // Make sure this is not an Instance we were supposed to skip.
   assert (testingPipe.precondition(source.peekNext()));
   return source.next();
 }
Пример #4
0
 public boolean hasNext() {
   return source.hasNext();
 }