sdsu.algorithms.data
Class ShiftedRangeGenarator

java.lang.Object
  |
  +--sdsu.algorithms.data.ShiftedRangeGenarator

public class ShiftedRangeGenarator
extends java.lang.Object
implements NumberGenerator

This class modifies a sequence of numbers. Given a number generator this generator shifts all numbers of the generator by a fixed value.

Version:
1.0 18 June 1997
Author:
Roger Whitney (whitney@cs.sdsu.edu)
See Also:
sdsu.data.NumberGenerator

Constructor Summary
ShiftedRangeGenarator(double shift, NumberGenerator aGenerator)
          Creates a generator that shifts the range of its generator.
 
Method Summary
 double nextElement()
          Returns the next number in a sequence.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShiftedRangeGenarator

public ShiftedRangeGenarator(double shift,
                             NumberGenerator aGenerator)
Creates a generator that shifts the range of its generator.
Parameters:
shift - the amount to translate the range aGenerator.
Method Detail

nextElement

public final double nextElement()
Returns the next number in a sequence. The number will be between the lower and upper bound of this generator.
Specified by:
nextElement in interface NumberGenerator