Exemplo n.º 1
0
 @Override
 public Simulation next() {
   if (exprIt == null) {
     throw new RuntimeException("Iterator not initialised, please call build()");
   }
   if (current == null || !current.hasNext()) {
     if (exprIt.hasNext()) current = exprIt.next();
     else throw new NoSuchElementException();
   }
   return current.next();
 }
Exemplo n.º 2
0
 @Override
 public boolean hasNext() {
   return exprIt.hasNext() || (current != null && current.hasNext());
 }