Klasse CustomGenerators.IntRandomNumberGenerator

java.lang.Object
ch.framedev.simplejavautils.CustomGenerators.IntRandomNumberGenerator
Umschließende Klasse:
CustomGenerators

public static final class CustomGenerators.IntRandomNumberGenerator extends Object
A nested class that generates random integers within a specified range.
  • Konstruktordetails

    • IntRandomNumberGenerator

      public IntRandomNumberGenerator()
      Initializes a new instance of the IntRandomNumberGenerator class.
    • IntRandomNumberGenerator

      public IntRandomNumberGenerator(int min, int max)
      Initializes a new random number generator that generates random integers within the specified range.
      Parameter:
      min - the minimum value inclusive
      max - the maximum value inclusive
  • Methodendetails

    • setMin

      Sets the minimum value for the random integer generation.
      Parameter:
      min - the minimum value inclusive
      Gibt zurück:
      this instance for method chaining
    • setMax

      Sets the maximum value for the random integer generation.
      Parameter:
      max - the maximum value inclusive
      Gibt zurück:
      this instance for method chaining
    • getMin

      public int getMin()
      Gets the minimum value for the random integer generation.
      Gibt zurück:
      the minimum value inclusive
    • getMax

      public int getMax()
      Gets the maximum value for the random integer generation.
      Gibt zurück:
      the maximum value inclusive
    • nextInt

      public int nextInt()
      Generates a random integer within the specified range.
      Gibt zurück:
      a random integer within the specified range