예제 #1
0
 @Override
 public Event next() {
   if (!walker.isOpen()) throw new IllegalStateException();
   fetchNextIfNeeded();
   if (next == null) throw new NoSuchElementException();
   Event result = next;
   next = null;
   return result;
 }
예제 #2
0
 @Override
 public boolean hasNext() {
   if (!walker.isOpen()) throw new IllegalStateException();
   fetchNextIfNeeded();
   return next != null;
 }