All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class rpi.goldsd.container.PrimeNumberSequence

java.lang.Object
   |
   +----rpi.goldsd.container.PrimeNumberSequence

public class PrimeNumberSequence
extends Object
implements Sequence
The PrimeNumberSequence class implements the Sequence interface by providing sequence() methods that generate enumerations of Int objects representing sequential prime numbers.

Version:
1.1, 4/16/98
Author:
David Goldschmidt
See Also:
Sequence

Constructor Index

 o PrimeNumberSequence()

Method Index

 o sequence()
Returns an enumeration of sequential prime number integer values starting at 2.
 o sequence(int)
Returns an enumeration of sequential prime number integer values starting at the given start value i.
 o sequence(Object)
Returns an enumeration of sequential prime number integer values starting at the given start value.

Constructors

 o PrimeNumberSequence
 public PrimeNumberSequence()

Methods

 o sequence
 public Enumeration sequence()
Returns an enumeration of sequential prime number integer values starting at 2. When the enumeration reaches the defined Int.MAX_VALUE value, the hasMoreElements() method returns false.

Returns:
an enumeration of sequential Int objects representing the prime numbers starting at 1.
 o sequence
 public Enumeration sequence(int i)
Returns an enumeration of sequential prime number integer values starting at the given start value i.

Parameters:
i - the start of the generated sequence.
Returns:
an enumeration of sequential prime number integer values starting at the given start value i.
 o sequence
 public Enumeration sequence(Object startValue) throws IllegalArgumentException
Returns an enumeration of sequential prime number integer values starting at the given start value. When the enumeration reaches the defined Int.MAX_VALUE value, the hasMoreElements() method returns false.

Parameters:
startValue - the Int object representing the start of the generated sequence.
Returns:
an enumeration of sequential Int objects representing the prime numbers.
Throws: IllegalArgumentException
if the startValue argument is not of type Int, or if startValue is not a prime number.

All Packages  Class Hierarchy  This Package  Previous  Next  Index