Package guru.mikelue.foxglove.functional
Class Int4SequenceSupplier
java.lang.Object
guru.mikelue.foxglove.functional.Int4SequenceSupplier
- All Implemented Interfaces:
SequenceSupplier<Integer>,StatefulSupplier<Integer>,IntSupplier,Supplier<Integer>
Provides consequent number with customizable start and steps.
The type is
Integer(4 bytes) based.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs the supplier with start value as 1 and step as 1.Int4SequenceSupplier(int startValue) Constructs the supplier with start value as 0 and step as 1.Int4SequenceSupplier(int startValue, int stepValue) Constructs the supplier with customizable start value and step. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface guru.mikelue.foxglove.functional.SequenceSupplier
get
-
Constructor Details
-
Int4SequenceSupplier
public Int4SequenceSupplier()Constructs the supplier with start value as 1 and step as 1.- See Also:
-
Int4SequenceSupplier
public Int4SequenceSupplier(int startValue) Constructs the supplier with start value as 0 and step as 1.- Parameters:
startValue- The start value- See Also:
-
Int4SequenceSupplier
public Int4SequenceSupplier(int startValue, int stepValue) Constructs the supplier with customizable start value and step.- Parameters:
startValue- The start valuestepValue- The step value- See Also:
-
-
Method Details
-
getAsInt
public int getAsInt()Gets the next value in sequence.- Specified by:
getAsIntin interfaceIntSupplier- Returns:
- The next value
-
nextValue
Gets the next value in sequence.- Specified by:
nextValuein interfaceSequenceSupplier<Integer>- Returns:
- The next value
-
lastValue
Gets the next value in sequence(without stepping).- Specified by:
lastValuein interfaceSequenceSupplier<Integer>- Returns:
- The current value
-