Class RandomRegistry.Runner

java.lang.Object
io.jenetics.util.RandomRegistry.Runner
Enclosing class:
RandomRegistry

public static final class RandomRegistry.Runner extends Object
Runs code with specifically bound random generator.
Since:
9.0
Version:
9.0
  • Method Details

    • run

      public void run(Runnable op)
      Runs an operation with each scoped value in this mapping bound to its value in the current thread.
      Parameters:
      op - the operation to run
    • call

      public <R, X extends Throwable> R call(ScopedValue.CallableOp<? extends R, X> op) throws X
      Calls a value-returning operation with each scoped random generator.
      Type Parameters:
      R - the type of the result of the operation
      X - type of the exception thrown by the operation
      Parameters:
      op - the operation to run
      Returns:
      the result
      Throws:
      X - if op completes with an exception