uk.org.bryanray.testtoys.generator.sequencegenerators
Class RandomNumberGenerator

java.lang.Object
  extended by uk.org.bryanray.testtoys.generator.sequencegenerators.RandomNumberGenerator
All Implemented Interfaces:
SequenceGenerator

public class RandomNumberGenerator
extends java.lang.Object
implements SequenceGenerator

Project:
TestDataLoader
Filename:
RandomNumberGenerator.java
Creation Date:
25 May 2008
A class that generates a random sequence of numbers. Supports formatting the number as specified by the user.

Author:
Bryan Ray

Constructor Summary
RandomNumberGenerator(java.util.List<java.lang.String> args)
           
 
Method Summary
 void next()
          Moves the sequence on one value.
 java.lang.String value()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomNumberGenerator

public RandomNumberGenerator(java.util.List<java.lang.String> args)
Parameters:
args - A List of three arguments:
  1. A pattern that defines how a DecimalFormat will format the number.
  2. A minimum value to be generated.
  3. A maximum value to be generated.
Method Detail

next

public void next()
Moves the sequence on one value.

Specified by:
next in interface SequenceGenerator

value

public java.lang.String value()

Specified by:
value in interface SequenceGenerator
Returns:
The current sequence value. This method should be ready to call immediately after initialisation of the instance object.


Copyright © 2008. All Rights Reserved.