Class DrawTest.FixedStream

java.lang.Object
org.opentrafficsim.core.math.DrawTest.FixedStream
All Implemented Interfaces:
Serializable, nl.tudelft.simulation.jstats.streams.StreamInterface
Enclosing class:
DrawTest

static class DrawTest.FixedStream extends Object implements nl.tudelft.simulation.jstats.streams.StreamInterface
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 interface nl.tudelft.simulation.jstats.streams.StreamInterface
    • nextDouble

      public double nextDouble()
      Specified by:
      nextDouble in interface nl.tudelft.simulation.jstats.streams.StreamInterface
    • nextFloat

      public float nextFloat()
      Specified by:
      nextFloat in interface nl.tudelft.simulation.jstats.streams.StreamInterface
    • nextInt

      public int nextInt()
      Specified by:
      nextInt in interface nl.tudelft.simulation.jstats.streams.StreamInterface
    • nextInt

      public int nextInt(int i, int j)
      Specified by:
      nextInt in interface nl.tudelft.simulation.jstats.streams.StreamInterface
    • nextLong

      public long nextLong()
      Specified by:
      nextLong in interface nl.tudelft.simulation.jstats.streams.StreamInterface
    • getSeed

      public long getSeed()
      Specified by:
      getSeed in interface nl.tudelft.simulation.jstats.streams.StreamInterface
    • setSeed

      public void setSeed(long seed)
      Specified by:
      setSeed in interface nl.tudelft.simulation.jstats.streams.StreamInterface
    • reset

      public void reset()
      Specified by:
      reset in interface nl.tudelft.simulation.jstats.streams.StreamInterface
    • saveState

      public byte[] saveState() throws nl.tudelft.simulation.jstats.streams.StreamException
      Specified by:
      saveState in interface nl.tudelft.simulation.jstats.streams.StreamInterface
      Throws:
      nl.tudelft.simulation.jstats.streams.StreamException
    • restoreState

      public void restoreState(byte[] state) throws nl.tudelft.simulation.jstats.streams.StreamException
      Specified by:
      restoreState in interface nl.tudelft.simulation.jstats.streams.StreamInterface
      Throws:
      nl.tudelft.simulation.jstats.streams.StreamException
    • getOriginalSeed

      public long getOriginalSeed()
      Specified by:
      getOriginalSeed in interface nl.tudelft.simulation.jstats.streams.StreamInterface