RandomGenerator classes should be Serializable
since they are used as fields of both Serializable RandomAdaptor and RandomDataImpl classes git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@611495 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
925880307d
commit
080a51a420
|
@ -16,6 +16,8 @@
|
|||
*/
|
||||
package org.apache.commons.math.random;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Interface extracted from <code>java.util.Random</code>. This interface is
|
||||
* implemented by {@link AbstractRandomGenerator}.
|
||||
|
@ -23,7 +25,7 @@ package org.apache.commons.math.random;
|
|||
* @since 1.1
|
||||
* @version $Revision:$ $Date$
|
||||
*/
|
||||
public interface RandomGenerator {
|
||||
public interface RandomGenerator extends Serializable {
|
||||
|
||||
/**
|
||||
* Sets the seed of the underyling random number generator using a
|
||||
|
|
|
@ -67,6 +67,8 @@ public class RandomAdaptorTest extends RandomDataTest {
|
|||
*/
|
||||
private static class ConstantGenerator implements RandomGenerator {
|
||||
|
||||
private static final long serialVersionUID = 5936262220824971138L;
|
||||
|
||||
public boolean nextBoolean() {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@ import java.util.Random;
|
|||
* @version $Revision:$ $Date$
|
||||
*/
|
||||
public class TestRandomGenerator extends AbstractRandomGenerator {
|
||||
|
||||
private static final long serialVersionUID = -9161426374178114548L;
|
||||
private Random random = new Random();
|
||||
|
||||
public void setSeed(long seed) {
|
||||
|
|
Loading…
Reference in New Issue