Package org.opentrafficsim.core.math
Class DrawTest.FixedStream
java.lang.Object
org.opentrafficsim.core.math.DrawTest.FixedStream
- All Implemented Interfaces:
Serializable
,StreamInterface
- Enclosing class:
- DrawTest
Implementation of StreamInterface that returns a constant value.
-
Constructor Details
-
FixedStream
FixedStream(double result) Construct a new FixedStream.- Parameters:
result
- double; the result of the nextDouble method. All other methods return a suitable approximation of this value.
-
-
Method Details
-
nextBoolean
public boolean nextBoolean()- Specified by:
nextBoolean
in interfaceStreamInterface
-
nextDouble
public double nextDouble()- Specified by:
nextDouble
in interfaceStreamInterface
-
nextFloat
public float nextFloat()- Specified by:
nextFloat
in interfaceStreamInterface
-
nextInt
public int nextInt()- Specified by:
nextInt
in interfaceStreamInterface
-
nextInt
public int nextInt(int i, int j) - Specified by:
nextInt
in interfaceStreamInterface
-
nextLong
public long nextLong()- Specified by:
nextLong
in interfaceStreamInterface
-
getSeed
public long getSeed()- Specified by:
getSeed
in interfaceStreamInterface
-
setSeed
public void setSeed(long seed) - Specified by:
setSeed
in interfaceStreamInterface
-
reset
public void reset()- Specified by:
reset
in interfaceStreamInterface
-
saveState
- Specified by:
saveState
in interfaceStreamInterface
- Throws:
StreamException
-
restoreState
- Specified by:
restoreState
in interfaceStreamInterface
- Throws:
StreamException
-
getOriginalSeed
public long getOriginalSeed()- Specified by:
getOriginalSeed
in interfaceStreamInterface
-