Class DefaultLongNumericGenerator

  • All Implemented Interfaces:
    LongNumericGenerator, NumericGenerator

    public class DefaultLongNumericGenerator
    extends java.lang.Object
    implements LongNumericGenerator
    The default numeric generator for generating long values. Implementation allows for wrapping (to restart count) if the maximum is reached.
    Since:
    3.0.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getNextLong()
      Get the next long in the sequence.
      java.lang.String getNextNumberAsString()
      Method to retrieve the next number as a String.
      protected long getNextValue()
      Gets the next value.
      int maxLength()
      The guaranteed maximum length of a String returned by this generator.
      int minLength()
      The guaranteed minimum length of a String returned by this generator.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultLongNumericGenerator

        public DefaultLongNumericGenerator()
        Instantiates a new default long numeric generator.
      • DefaultLongNumericGenerator

        public DefaultLongNumericGenerator​(long initialValue)
        Instantiates a new default long numeric generator.
        Parameters:
        initialValue - the initial value
    • Method Detail

      • getNextNumberAsString

        public java.lang.String getNextNumberAsString()
        Description copied from interface: NumericGenerator
        Method to retrieve the next number as a String.
        Specified by:
        getNextNumberAsString in interface NumericGenerator
        Returns:
        the String representation of the next number in the sequence
      • maxLength

        public int maxLength()
        Description copied from interface: NumericGenerator
        The guaranteed maximum length of a String returned by this generator.
        Specified by:
        maxLength in interface NumericGenerator
        Returns:
        the maximum length
      • minLength

        public int minLength()
        Description copied from interface: NumericGenerator
        The guaranteed minimum length of a String returned by this generator.
        Specified by:
        minLength in interface NumericGenerator
        Returns:
        the minimum length.
      • getNextValue

        protected long getNextValue()
        Gets the next value.
        Returns:
        the next value. If the count has reached Long.MAX_VALUE, then Long.MAX_VALUE is returned. Otherwise, the next increment.