Class StepSequence

  • All Implemented Interfaces:
    Distribution

    public class StepSequence
    extends Sequence
    Creates numbers by continuously incrementing a base value by a constant amount.

    Created at 30.06.2009 09:55:20
    Since:
    0.6.0
    Author:
    Volker Bergmann
    • Constructor Summary

      Constructors 
      Constructor Description
      StepSequence()
      Instantiates a new Step sequence.
      StepSequence​(java.math.BigDecimal delta)
      Instantiates a new Step sequence.
      StepSequence​(java.math.BigDecimal delta, java.math.BigDecimal initial)
      Instantiates a new Step sequence.
      StepSequence​(java.math.BigDecimal delta, java.math.BigDecimal initial, java.math.BigDecimal limit)
      Instantiates a new Step sequence.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> Generator<T> applyTo​(Generator<T> source, boolean unique)
      Apply to generator.
      <T extends java.lang.Number>
      NonNullGenerator<T>
      createNumberGenerator​(java.lang.Class<T> numberType, T min, T max, T granularity, boolean unique)
      Create number generator non null generator.
      java.math.BigDecimal getDelta()
      Gets delta.
      java.math.BigDecimal getInitial()
      Gets initial.
      void setDelta​(java.math.BigDecimal delta)
      Sets delta.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • StepSequence

        public StepSequence()
        Instantiates a new Step sequence.
      • StepSequence

        public StepSequence​(java.math.BigDecimal delta)
        Instantiates a new Step sequence.
        Parameters:
        delta - the increment to choose for created generators. When using null, the granularity parameter will be used to set the increment in createNumberGenerator(Class, Number, Number, Number, boolean)
      • StepSequence

        public StepSequence​(java.math.BigDecimal delta,
                            java.math.BigDecimal initial)
        Instantiates a new Step sequence.
        Parameters:
        delta - the delta
        initial - the initial
      • StepSequence

        public StepSequence​(java.math.BigDecimal delta,
                            java.math.BigDecimal initial,
                            java.math.BigDecimal limit)
        Instantiates a new Step sequence.
        Parameters:
        delta - the delta
        initial - the initial
        limit - the limit
    • Method Detail

      • setDelta

        public void setDelta​(java.math.BigDecimal delta)
        Sets delta.
        Parameters:
        delta - the delta
      • getDelta

        public java.math.BigDecimal getDelta()
        Gets delta.
        Returns:
        the delta
      • getInitial

        public java.math.BigDecimal getInitial()
        Gets initial.
        Returns:
        the initial
      • applyTo

        public <T> Generator<T> applyTo​(Generator<T> source,
                                        boolean unique)
        Description copied from interface: Distribution
        Apply to generator.
        Specified by:
        applyTo in interface Distribution
        Overrides:
        applyTo in class Sequence
        Type Parameters:
        T - the type parameter
        Parameters:
        source - the source
        unique - the unique
        Returns:
        the generator
      • createNumberGenerator

        public <T extends java.lang.Number> NonNullGenerator<T> createNumberGenerator​(java.lang.Class<T> numberType,
                                                                                      T min,
                                                                                      T max,
                                                                                      T granularity,
                                                                                      boolean unique)
        Description copied from interface: Distribution
        Create number generator non null generator.
        Type Parameters:
        T - the type parameter
        Parameters:
        numberType - the number type
        min - the min
        max - the max
        granularity - the granularity
        unique - the unique
        Returns:
        the non null generator
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Sequence