Class BigDecimalValueRange

    • Constructor Detail

      • BigDecimalValueRange

        public BigDecimalValueRange​(BigDecimal from,
                                    BigDecimal to)
        All parameters must have the same BigDecimal.scale().
        Parameters:
        from - never null, inclusive minimum
        to - never null, exclusive maximum, >= from
      • BigDecimalValueRange

        public BigDecimalValueRange​(BigDecimal from,
                                    BigDecimal to,
                                    BigDecimal incrementUnit)
        All parameters must have the same BigDecimal.scale().
        Parameters:
        from - never null, inclusive minimum
        to - never null, exclusive maximum, >= from
        incrementUnit - never null, > 0
    • Method Detail

      • getSize

        public long getSize()
        Description copied from interface: CountableValueRange
        Used by uniform random selection in a composite or nullable CountableValueRange.
        Returns:
        the exact number of elements generated by this CountableValueRange, always >= 0
      • contains

        public boolean contains​(BigDecimal value)
        Parameters:
        value - sometimes null
        Returns:
        true if the ValueRange contains that value
      • createOriginalIterator

        public Iterator<BigDecimal> createOriginalIterator()
        Description copied from interface: CountableValueRange
        Select the elements in original (natural) order.
        Returns:
        never null
      • createRandomIterator

        public Iterator<BigDecimal> createRandomIterator​(Random workingRandom)
        Description copied from interface: ValueRange
        Select in random order, but without shuffling the elements. Each element might be selected multiple times. Scales well because it does not require caching.
        Parameters:
        workingRandom - never null, the Random to use when any random number is needed, so EnvironmentMode.REPRODUCIBLE works correctly. RandomUtils can be useful too.
        Returns:
        never null