Class LongsRandomGenerator

java.lang.Object
org.midheaven.math.LongsRandomGenerator
All Implemented Interfaces:
DiscreteIntervalRandomGenerator<Long>, IntervalRandomGenerator<Long>, RandomGenerator<Long>

public final class LongsRandomGenerator extends Object implements IntervalRandomGenerator<Long>
Generator for Longs Random values.
  • Method Details

    • nextIncluding

      protected Long nextIncluding(Long upperBound)
      Returns next Including.
      Parameters:
      upperBound - the upperBound value
      Returns:
      the result of nextIncluding
    • nextIncluding

      protected Long nextIncluding(Long lowerBound, Long upperBound)
      Returns next Including.
      Parameters:
      lowerBound - the lowerBound value
      upperBound - the upperBound value
      Returns:
      the result of nextIncluding
    • next

      protected Long next(Long upperBound)
      Performs next.
      Parameters:
      upperBound - the upperBound value
      Returns:
      the result of next
    • next

      protected Long next(Long lowerBound, Long upperBound)
      Performs next.
      Parameters:
      lowerBound - the lowerBound value
      upperBound - the upperBound value
      Returns:
      the result of next
    • compare

      protected int compare(Long a, Long b)
      Performs compare.
      Parameters:
      a - the a value
      b - the b value
      Returns:
      the result of compare
    • next

      public Long next()
      Performs next.
      Specified by:
      next in interface RandomGenerator<Long>
      Returns:
      the result of next
    • stream

      public Stream<Long> stream()
      Performs stream.
      Specified by:
      stream in interface RandomGenerator<Long>
      Returns:
      the result of stream
    • upToIncluding

      public RandomGenerator<Long> upToIncluding(Long upperBound)
      Description copied from interface: DiscreteIntervalRandomGenerator
      Performs upToIncluding.
      Specified by:
      upToIncluding in interface DiscreteIntervalRandomGenerator<T>
      Parameters:
      upperBound - the upperBound value
      Returns:
      the result of upToIncluding
    • betweenIncluding

      public RandomGenerator<Long> betweenIncluding(Long lowerBound, Long upperBound)
      Description copied from interface: DiscreteIntervalRandomGenerator
      Performs betweenIncluding.
      Specified by:
      betweenIncluding in interface DiscreteIntervalRandomGenerator<T>
      Parameters:
      lowerBound - the lowerBound value
      upperBound - the upperBound value
      Returns:
      the result of betweenIncluding
    • upTo

      public RandomGenerator<Long> upTo(Long upperBound)
      Description copied from interface: IntervalRandomGenerator
      Performs upTo.
      Specified by:
      upTo in interface IntervalRandomGenerator<T>
      Parameters:
      upperBound - the upperBound value
      Returns:
      the result of upTo
    • between

      public RandomGenerator<Long> between(Long lowerBound, Long upperBound)
      Description copied from interface: IntervalRandomGenerator
      Performs between.
      Specified by:
      between in interface IntervalRandomGenerator<T>
      Parameters:
      lowerBound - the lowerBound value
      upperBound - the upperBound value
      Returns:
      the result of between
    • checkBounds

      protected final int checkBounds(Long lowerBound, Long upperBound)
    • base

      protected final Random base()
      Performs base.
      Returns:
      the result of base