Class IncrementalSequenceGenerator
java.lang.Object
com.sportradar.livedata.sdk.common.classes.IncrementalSequenceGenerator
- All Implemented Interfaces:
SequenceGenerator
A
SequenceGenerator implementation where each value is obtained by incrementing
the previous one.- Author:
- uros.bregar
-
Constructor Summary
ConstructorsConstructorDescriptionIncrementalSequenceGenerator(long minValue, long maxValue) Initializes a new instance of theIncrementalSequenceGeneratorclass.IncrementalSequenceGenerator(long minValue, long maxValue, boolean initialRandomSelected) Initializes a new instance of theIncrementalSequenceGeneratorclass. -
Method Summary
-
Constructor Details
-
IncrementalSequenceGenerator
public IncrementalSequenceGenerator(long minValue, long maxValue) Initializes a new instance of theIncrementalSequenceGeneratorclass.- Parameters:
minValue- The min allowed value of the counter.maxValue- The max allowed value of the counter. When the value is reached the value restarts at minValue.
-
IncrementalSequenceGenerator
public IncrementalSequenceGenerator(long minValue, long maxValue, boolean initialRandomSelected) Initializes a new instance of theIncrementalSequenceGeneratorclass.- Parameters:
minValue- The min allowed value of the counter.maxValue- The max allowed value of the counter. When the value is reached the value restarts at minValue.initialRandomSelected- If true, initial value will be randomly selected between minValue and maxValue
-
-
Method Details
-
getNext
public long getNext()Generates and returns next sequence number.- Specified by:
getNextin interfaceSequenceGenerator- Returns:
- next sequence number.
-