Package guru.mikelue.foxglove.functional
Class RowIndexToValueSupplier<T>
java.lang.Object
guru.mikelue.foxglove.functional.RowIndexToValueSupplier<T>
- Type Parameters:
T- Type of value to be provided
- All Implemented Interfaces:
StatefulSupplier<T>,Supplier<T>
This is a stateful
Supplier, which need client code to implements Function.apply(T) method.
The value of row index is maintained internally which is fed to Function.apply(T).-
Method Summary
Modifier and TypeMethodDescriptionget()Gets the value at current row index, then advances the row index by one.intGets the the row index to be used for next time calling ofget().static <T> RowIndexToValueSupplier<T> of(RowIndexToValue<T> toValueFunc) Creates the supplier with given function to get value at specified row index.
-
Method Details
-
of
Creates the supplier with given function to get value at specified row index.- Type Parameters:
T- The type of value supplied- Parameters:
toValueFunc- The function to get value at specified row index- Returns:
- The created supplier
-
get
Gets the value at current row index, then advances the row index by one. -
getCurrentIndex
public int getCurrentIndex()Gets the the row index to be used for next time calling ofget().- Returns:
- The value at specified row index
-