Class RationalRandomGenerator

java.lang.Object
org.midheaven.math.RationalRandomGenerator
All Implemented Interfaces:
IntervalRandomGenerator<Rational>, RandomGenerator<Rational>

public class RationalRandomGenerator extends Object
Generator for Rational Random values.
  • Method Details

    • next

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

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

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

      public Rational next()
      Performs next.
      Returns:
      the result of next
    • upTo

      public RandomGenerator<Rational> upTo(Rational 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<Rational> between(Rational lowerBound, Rational 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(Rational lowerBound, Rational upperBound)
    • base

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