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
-
endValue
- Default end value for all sequence() methods.
-
startValue
- Default start value for the no-argument sequence() method.
-
IntSequence()
- Constructs an IntSequence object.
-
IntSequence(int)
- Constructs an IntSequence object with the specified
startValue default value.
-
IntSequence(int, int)
- Constructs an IntSequence object with the specified
startValue and endValue default values.
-
sequence()
- Returns an enumeration of sequential integer values starting at 1.
-
sequence(int)
- Returns an enumeration of sequential integer values starting
at the given start value i.
-
sequence(Object)
- Returns an enumeration of sequential integer values starting
at the given start value.
startValue
protected int startValue
- Default start value for the no-argument sequence() method.
endValue
protected int endValue
- Default end value for all sequence() methods.
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.
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.
IntSequence
public IntSequence()
- Constructs an IntSequence object.
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.
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.
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