edu.usc.bg.base.generator
Class ConstantIntegerGenerator

java.lang.Object
  extended by edu.usc.bg.base.generator.Generator
      extended by edu.usc.bg.base.generator.IntegerGenerator
          extended by edu.usc.bg.base.generator.ConstantIntegerGenerator

public class ConstantIntegerGenerator
extends IntegerGenerator

A trivial integer generator that always returns the same value.

Author:
sears

Constructor Summary
ConstantIntegerGenerator(int i)
           
 
Method Summary
 double mean()
          Return the expected value (mean) of the values this generator will return.
 int nextInt()
          Return the next value as an int.
 
Methods inherited from class edu.usc.bg.base.generator.IntegerGenerator
lastInt, lastString, nextString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstantIntegerGenerator

public ConstantIntegerGenerator(int i)
Parameters:
i - The integer that this generator will always return.
Method Detail

nextInt

public int nextInt()
Description copied from class: IntegerGenerator
Return the next value as an int. When overriding this method, be sure to call setLastString() properly, or the lastString() call won't work.

Specified by:
nextInt in class IntegerGenerator

mean

public double mean()
Description copied from class: IntegerGenerator
Return the expected value (mean) of the values this generator will return.

Specified by:
mean in class IntegerGenerator