Class IncrementalSequenceGenerator

    • Constructor Detail

      • IncrementalSequenceGenerator

        public IncrementalSequenceGenerator​(long minValue,
                                            long maxValue)
        Initializes a new instance of the IncrementalSequenceGenerator class.
        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 the IncrementalSequenceGenerator class.
        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 Detail

      • getNext

        public long getNext()
        Generates and returns next sequence number.
        Specified by:
        getNext in interface SequenceGenerator
        Returns:
        next sequence number.