Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Won't Fix
-
None
-
None
-
None
Description
I proposed to create a base class which the existing abstract classes AbstractRandomGenerator and BitsStreamGenerator will extend.
This would allow to define nextBytes(byte[]) at the base class level.
The code for that method is almost identical in the two hierarchies: they only differ in a call to either nextInt() or next(32) respectively; the latter is however the same as the former, in disguise, and is not subject to change given the type of return value.
As a corollary, the new base class can be the unique place where to add utilities such as the one proposed in MATH-1306.
Update: AbstractRandomGenerator and BitsStreamGenerator are both obsoleted by the class proposed in this report.