Class FastRandomCollection<T>

java.lang.Object
com.fastasyncworldedit.core.util.collection.RandomCollection<T>
com.fastasyncworldedit.core.util.collection.FastRandomCollection<T>

public class FastRandomCollection<T> extends RandomCollection<T>
  • Method Details

    • create

      public static <T> Optional<RandomCollection<T>> create(Map<T,Double> weights, SimpleRandom random)
      Create a new FastRandomCollection if the given values and weights match the criteria. The criteria may change at any point, so this method isn't guaranteed to return a non-empty Optional in any case.
      Type Parameters:
      T - the value type.
      Parameters:
      weights - the weight of the values.
      random - the random generator to use for this collection.
      Returns:
      an Optional containing the new collection if it could be created, Optional.empty() otherwise.
      See Also:
    • next

      public T next(int x, int y, int z)
      Specified by:
      next in class RandomCollection<T>