All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class rpi.goldsd.container.IntSequence

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

public class IntSequence
extends Object
implements Sequence
The IntSequence class implements the Sequence interface by providing sequence() methods that generate enumerations of Int objects. This class is generally used to provide a sequence-generator for unique key-values in hashtables and other associative containers.

Version:
1.2, 5/11/98
Author:
David Goldschmidt
See Also:
Sequence

Variable Index

 o endValue
Default end value for all sequence() methods.
 o startValue
Default start value for the no-argument sequence() method.

Constructor Index

 o IntSequence()
Constructs an IntSequence object.
 o IntSequence(int)
Constructs an IntSequence object with the specified startValue default value.
 o IntSequence(int, int)
Constructs an IntSequence object with the specified startValue and endValue default values.

Method Index

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

Variables

 o startValue
 protected int startValue
Default start value for the no-argument sequence() method.

 o endValue
 protected int endValue
Default end value for all sequence() methods.

Constructors

 o IntSequence
 public IntSequence(int startValue,
                    int endValue)
Constructs an IntSequence object with the specified startValue and endValue default values.

Parameters:
startValue - used by the default sequence() method as the default start value.
endValue - used by all sequence() methods as the default end value.
 o IntSequence
 public IntSequence(int startValue)
Constructs an IntSequence object with the specified startValue default value.

Parameters:
startValue - used by the default sequence() method as the default start value.
 o IntSequence
 public IntSequence()
Constructs an IntSequence object.

Methods

 o sequence
 public Enumeration sequence()
Returns an enumeration of sequential integer values starting at 1. The hasMoreElements() method of the enumeration always returns true since the nextElement() method will always return the next Int object in the sequence. When the enumeration reaches the defined Int.MAX_VALUE value, the sequence "wraps around" to 1.

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

Parameters:
i - the start of the generated sequence.
Returns:
an enumeration of sequential integer values starting at the given start value i.
 o sequence
 public Enumeration sequence(Object startValue) throws IllegalArgumentException
Returns an enumeration of sequential integer values starting at the given start value. The hasMoreElements() method of the enumeration always returns true since the nextElement() method will always return the next Int object in the sequence. When the enumeration reaches the defined Int.MAX_VALUE, the sequence "wraps around" to the given start value.

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

All Packages  Class Hierarchy  This Package  Previous  Next  Index