Class DynamicLongGenerator

  • All Implemented Interfaces:
    Generator<java.lang.Long>, com.rapiddweller.common.Resettable, com.rapiddweller.common.ThreadAware, java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    DynamicCountGenerator

    public class DynamicLongGenerator
    extends GeneratorProxy<java.lang.Long>
    Generator implementation that generates Long numbers, redefining the underlying distribution on each reset() by evaluating the min, max, granularity, distribution and unique values.

    Created: 27.03.2010 19:28:38
    Since:
    0.6.0
    Author:
    Volker Bergmann
    • Field Detail

      • min

        protected final com.rapiddweller.script.Expression<java.lang.Long> min
        The Min.
      • max

        protected final com.rapiddweller.script.Expression<java.lang.Long> max
        The Max.
      • granularity

        protected final com.rapiddweller.script.Expression<java.lang.Long> granularity
        The Granularity.
      • distribution

        protected final com.rapiddweller.script.Expression<? extends Distribution> distribution
        The Distribution.
    • Constructor Detail

      • DynamicLongGenerator

        public DynamicLongGenerator()
        Instantiates a new Dynamic long generator.
      • DynamicLongGenerator

        public DynamicLongGenerator​(com.rapiddweller.script.Expression<java.lang.Long> min,
                                    com.rapiddweller.script.Expression<java.lang.Long> max,
                                    com.rapiddweller.script.Expression<java.lang.Long> granularity,
                                    com.rapiddweller.script.Expression<? extends Distribution> distribution,
                                    com.rapiddweller.script.Expression<java.lang.Boolean> unique)
        Instantiates a new Dynamic long generator.
        Parameters:
        min - the min
        max - the max
        granularity - the granularity
        distribution - the distribution
        unique - the unique
    • Method Detail

      • init

        public void init​(GeneratorContext context)
        ensures consistency of the state
        Specified by:
        init in interface Generator<java.lang.Long>
        Overrides:
        init in class GeneratorWrapper<java.lang.Long,​java.lang.Long>
        Parameters:
        context - the context
      • reset

        public void reset()
        Specified by:
        reset in interface com.rapiddweller.common.Resettable
        Overrides:
        reset in class GeneratorWrapper<java.lang.Long,​java.lang.Long>
      • resetMembers

        protected void resetMembers​(java.lang.Long minValue,
                                    java.lang.Long maxValue)
        Reset members.
        Parameters:
        minValue - the min value
        maxValue - the max value