Package org.unitConverter.math
Class ConditionalExistenceCollections.ConditionalExistenceIterator<E>
- java.lang.Object
-
- org.unitConverter.math.ConditionalExistenceCollections.ConditionalExistenceIterator<E>
-
- Type Parameters:
E- type of elements in iterator
- All Implemented Interfaces:
java.util.Iterator<E>
- Enclosing class:
- ConditionalExistenceCollections
static final class ConditionalExistenceCollections.ConditionalExistenceIterator<E> extends java.lang.Object implements java.util.Iterator<E>Elements in this wrapper iterator only exist if they pass a condition.- Since:
- 2019-10-17
- Author:
- Adrien Hopkins
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.function.Predicate<E>existenceCondition(package private) booleanhasNext(package private) java.util.Iterator<E>iterator(package private) EnextElement
-
Constructor Summary
Constructors Modifier Constructor Description privateConditionalExistenceIterator(java.util.Iterator<E> iterator, java.util.function.Predicate<E> condition)Creates theConditionalExistenceIterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidgetAndSetNextElement()Gets the next element, and sets nextElement and hasNext accordingly.booleanhasNext()Enext()voidremove()
-
-
-
Method Detail
-
getAndSetNextElement
private void getAndSetNextElement()
Gets the next element, and sets nextElement and hasNext accordingly.- Since:
- 2019-10-17
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<E>
-
remove
public void remove()
- Specified by:
removein interfacejava.util.Iterator<E>
-
-