All Packages Class Hierarchy This Package Previous Next Index
Class rpi.goldsd.container.RandomIntSequence
java.lang.Object
|
+----rpi.goldsd.container.RandomIntSequence
- public class RandomIntSequence
- extends Object
- implements Sequence
The RandomIntSequence class implements the Sequence
interface by providing a sequence() method that generates an
enumeration of Int objects using a linear congruential method.
This is not a very useful class, but rather an "excursion" as part of this
project.
- Version:
- 1.0, 4/16/98
- Author:
- David Goldschmidt
- See Also:
- Sequence
-
RandomIntSequence()
-
-
sequence()
- Returns an enumeration of pseudo-random integer values using
the linear congruential method with a default value of 25 as the
seed value.
-
sequence(int)
- Returns an enumeration of pseudo-random integer values using the
given seed value s.
-
sequence(Object)
- Returns an enumeration of pseudo-random integer values using
the linear congruential method.
RandomIntSequence
public RandomIntSequence()
sequence
public Enumeration sequence()
- Returns an enumeration of pseudo-random integer values using
the linear congruential method with a default value of 25 as the
seed value. The hasMoreElements() method of the
enumeration always returns true since the
nextElement() method will always return the next Int
object in the sequence.
- Returns:
- an enumeration of pseudo-random Int objects.
- Throws: IllegalArgumentException
- if the startValue argument
is not of type Int.
sequence
public Enumeration sequence(int s)
- Returns an enumeration of pseudo-random integer values using the
given seed value s.
- Parameters:
- s - the seed of the generated pseudo-random sequence.
- Returns:
- an enumeration of pseudo-random integer values using the
given seed value s.
sequence
public Enumeration sequence(Object startValue) throws IllegalArgumentException
- Returns an enumeration of pseudo-random integer values using
the linear congruential method. The hasMoreElements()
method of the enumeration always returns true since the
nextElement() method will always return the next Int
object in the sequence.
- Parameters:
- startValue - the seed value used to begin the linear
congruential process.
- Returns:
- an enumeration of pseudo-random Int objects.
- Throws: IllegalArgumentException
- if the startValue argument
is not of type Int.
All Packages Class Hierarchy This Package Previous Next Index