Class Random

java.lang.Object
net.mst.utilities.mathematical.Random

public class Random extends Object
Picks random values of given collection or range
  • Constructor Details

    • Random

      public Random()
  • Method Details

    • pick

      public static Integer pick(Integer Start, Integer End)
      Returns an random integer in a range
      Parameters:
      Start - The starting point of the range
      End - The end point of the range
      Returns:
      Integer between two given integer values
    • pick

      public static Double pick(Double Start, Double End)
      Returns an random double in a range
      Parameters:
      Start - The starting point of the range
      End - The end point of the range
      Returns:
      Double between two given double values
    • pickOf

      public static <T> T pickOf(Collection<T> Collection)
      Returns an random element of a collection
      Type Parameters:
      T - Type of the objects
      Parameters:
      Collection - The collection with all values
      Returns:
      Random element of collection