Class EditingFloatIterator
java.lang.Object
com.github.tommyettinger.ds.support.util.EditingFloatIterator
- All Implemented Interfaces:
FloatIterator,Iterator<Float>
Wraps an Iterator so that it calls a function on each item it would otherwise return, and returns that function's
result.
If you need to return a different type than what the iterator returns, you can use an
You can change both the Iterator and editor at once using
AlteringIterator.
This has undefined behavior if any items the Iterator could return are modified during iteration.
You can change both the Iterator and editor at once using
set(FloatIterator, FloatToFloatFunction) ,
and can also just change the Iterator with set(FloatIterator).-
Field Summary
FieldsModifier and TypeFieldDescriptioncom.github.tommyettinger.function.FloatToFloatFunction -
Constructor Summary
ConstructorsConstructorDescriptionEditingFloatIterator(FloatIterator iterator, com.github.tommyettinger.function.FloatToFloatFunction editor) -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasNext()floatReturns the nextfloatelement in the iteration.voidremove()voidset(FloatIterator iterator) voidset(FloatIterator iterator, com.github.tommyettinger.function.FloatToFloatFunction editor) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.github.tommyettinger.ds.support.util.FloatIterator
forEachRemaining, nextMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
iterator
-
editor
public com.github.tommyettinger.function.FloatToFloatFunction editor
-
-
Constructor Details
-
EditingFloatIterator
public EditingFloatIterator() -
EditingFloatIterator
public EditingFloatIterator(FloatIterator iterator, com.github.tommyettinger.function.FloatToFloatFunction editor)
-
-
Method Details
-
set
public void set(FloatIterator iterator, com.github.tommyettinger.function.FloatToFloatFunction editor) -
set
-
hasNext
public boolean hasNext() -
nextFloat
public float nextFloat()Description copied from interface:FloatIteratorReturns the nextfloatelement in the iteration.- Specified by:
nextFloatin interfaceFloatIterator- Returns:
- the next
floatelement in the iteration
-
remove
public void remove()
-