Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## umontreal.iro.lecuyer.rng
Class RandomStreamManager

    java.lang.Object
      umontreal.iro.lecuyer.rng.RandomStreamManager

    public class RandomStreamManager

extends Object

Manages a list of random streams for more convenient synchronization. All streams in the list can be reset simultaneously by a single call to the appropriate method of this stream manager, instead of calling explicitly the reset method for each individual stream.

After a random stream manager is constructed, any existing `RandomStream` object can be registered to this stream manager (i.e., added to the list) and eventually unregistered (removed from the list).

Constructor Summary
`RandomStreamManager()`

Method Summary
`RandomStream` | `add(RandomStream stream)` Adds the given `stream` to the internal list of this random stream manager and returns the added stream.
`void` | `clear()` Removes all the streams from the internal list of this random stream manager.
`List` | `getStreams()` Returns an unmodifiable list containing all the random streams in this random stream manager.
`boolean` | `remove(RandomStream stream)` Removes the given stream from the internal list of this random stream manager.
`void` | `resetNextSubstream()` Forwards to the `resetNextSubstream` methods of all streams in the list.
`void` | `resetStartStream()` Forwards to the `resetStartStream` methods of all streams in the list.
`void` | `resetStartSubstream()` Forwards to the `resetStartSubstream` methods of all streams in the list.
`String` | `toString()`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### RandomStreamManager

    public RandomStreamManager()

Method Detail

### add

    public RandomStream add(RandomStream stream)

  Adds the given `stream` to the internal list of this random stream manager and returns the added stream.

  Parameters:
    `stream` - the stream being added.
  Returns:
    the added stream.
  Throws:
    `NullPointerException` - if `stream` is `null`.

### remove

    public boolean remove(RandomStream stream)

  Removes the given stream from the internal list of this random stream manager. Returns `true` if the stream was properly removed, `false` otherwise.

  Parameters:
    `stream` - the stream being removed.
  Returns:
    the success indicator of the operation.

### clear

    public void clear()

  Removes all the streams from the internal list of this random stream manager.

### getStreams

    public List getStreams()

  Returns an unmodifiable list containing all the random streams in this random stream manager. The returned list, constructed by `unmodifiableList`, can be assumed to contain non-`null` `RandomStream` instances.

  Returns:
    the list of managed random streams.

### resetStartStream

    public void resetStartStream()

  Forwards to the `resetStartStream` methods of all streams in the list.

### resetStartSubstream

    public void resetStartSubstream()

  Forwards to the `resetStartSubstream` methods of all streams in the list.

### resetNextSubstream

    public void resetNextSubstream()

  Forwards to the `resetNextSubstream` methods of all streams in the list.

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.