Class LazyIterator<T>
java.lang.Object
de.renebergelt.quiterables.iterators.LazyIterator<T>
- Type Parameters:
T- Type of the elements in this Iterable
- All Implemented Interfaces:
Iterator<T>
Base class for the lazy iterators
Derived classes only need to implement the findNextElement() function
- Author:
- René Bergelt
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanIndicates if this iterator reached the endprotected TThe cached next element (if any) -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
nextElement
The cached next element (if any) -
ended
protected boolean endedIndicates if this iterator reached the end
-
-
Constructor Details
-
LazyIterator
public LazyIterator()
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
findNextElement
Return the next element which satisfies the predicate Return null to indicate that there will be no more objects- Returns:
- The next element or null
-
remove
public void remove()
-