Class TwoCmres.Cmres.Factory
java.lang.Object
org.apache.commons.rng.core.source64.TwoCmres.Cmres.Factory
- Enclosing class:
TwoCmres.Cmres
Factory.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final List
<TwoCmres.Cmres> List of good "Cmres" subcycle generators. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
add
(long multiply, int rotate, int start) Adds an entry to theTABLE
.(package private) static void
checkUnique
(List<TwoCmres.Cmres> table, long multiply) Check the multiply parameter is unique (not contained in any entry in the provided table).(package private) TwoCmres.Cmres
get
(int index) (package private) TwoCmres.Cmres
getIfDifferent
(int index, int other) Get the generator atindex
if theother
index is different.(package private) int
-
Field Details
-
TABLE
List of good "Cmres" subcycle generators.
-
-
Constructor Details
-
Factory
Factory()
-
-
Method Details
-
numberOfSubcycleGenerators
int numberOfSubcycleGenerators()- Returns:
- the number of subcycle generators.
-
get
- Parameters:
index
- Index into the list of available generators.- Returns:
- the subcycle generator entry at index
index
.
-
getIfDifferent
Get the generator atindex
if theother
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 theTABLE
.- Parameters:
multiply
- Multiplier.rotate
- Rotate.start
- Cycle start.
-
checkUnique
Check the multiply parameter is unique (not contained in any entry in the provided table).- Parameters:
table
- the tablemultiply
- the multiply parameter
-