Class TwoCmres.Cmres.Factory

java.lang.Object
org.apache.commons.rng.core.source64.TwoCmres.Cmres.Factory
Enclosing class:
TwoCmres.Cmres

static class TwoCmres.Cmres.Factory extends Object
Factory.
  • Field Details

    • TABLE

      private static final List<TwoCmres.Cmres> TABLE
      List of good "Cmres" subcycle generators.
  • Constructor Details

    • Factory

      Factory()
  • Method Details

    • numberOfSubcycleGenerators

      int numberOfSubcycleGenerators()
      Returns:
      the number of subcycle generators.
    • get

      TwoCmres.Cmres get(int index)
      Parameters:
      index - Index into the list of available generators.
      Returns:
      the subcycle generator entry at index index.
    • getIfDifferent

      TwoCmres.Cmres getIfDifferent(int index, int other)
      Get the generator at index if the other index is different.

      This method exists to raise an exception before invocation of the private constructor; this mitigates Finalizer attacks (see SpotBugs CT_CONSTRUCTOR_THROW).

      Parameters:
      index - Index into the list of available generators.
      other - Other index.
      Returns:
      the subcycle generator entry at index index.
    • add

      private static void add(long multiply, int rotate, int start)
      Adds an entry to the TABLE.
      Parameters:
      multiply - Multiplier.
      rotate - Rotate.
      start - Cycle start.
    • checkUnique

      static void checkUnique(List<TwoCmres.Cmres> table, long multiply)
      Check the multiply parameter is unique (not contained in any entry in the provided table).
      Parameters:
      table - the table
      multiply - the multiply parameter