Package guru.mikelue.foxglove.functional
Class Int8SequenceSupplier
java.lang.Object
guru.mikelue.foxglove.functional.Int8SequenceSupplier
- All Implemented Interfaces:
SequenceSupplier<Long>,StatefulSupplier<Long>,LongSupplier,Supplier<Long>
Provides consequent number with customizable start and steps.
The type is
Long(8 bytes) based.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs the supplier with start value as 1 and step as 1.Int8SequenceSupplier(long startValue) Constructs the supplier with start value as 0 and step as 1.Int8SequenceSupplier(long 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
-
Int8SequenceSupplier
public Int8SequenceSupplier()Constructs the supplier with start value as 1 and step as 1.- See Also:
-
Int8SequenceSupplier
public Int8SequenceSupplier(long startValue) Constructs the supplier with start value as 0 and step as 1.- Parameters:
startValue- The start value- See Also:
-
Int8SequenceSupplier
public Int8SequenceSupplier(long startValue, int stepValue) Constructs the supplier with customizable start value and step.- Parameters:
startValue- The start valuestepValue- The step value- See Also:
-
-
Method Details
-
getAsLong
public long getAsLong()Gets the next value in sequence.- Specified by:
getAsLongin interfaceLongSupplier- Returns:
- The next value
-
nextValue
Gets the next value in sequence.- Specified by:
nextValuein interfaceSequenceSupplier<Long>- Returns:
- The next value
-
lastValue
Gets the next value in sequence(without stepping).- Specified by:
lastValuein interfaceSequenceSupplier<Long>- Returns:
- The current value
-