pl.kernelpanic.dbmonster.generator
Class NumberGenerator

java.lang.Object
  extended bypl.kernelpanic.dbmonster.generator.BasicDataGenerator
      extended bypl.kernelpanic.dbmonster.generator.NumberGenerator
All Implemented Interfaces:
DataGenerator, Initializable

public class NumberGenerator
extends BasicDataGenerator
implements Initializable

The generator which only produces nulls.

Version:
$Id: NumberGenerator.html,v 1.1 2007/06/21 08:38:14 sbahloul Exp $
Author:
Piotr Maj <piotr.maj@kernelpanic.pl>

Field Summary
static int DOUBLE
          Result should be double.
static int FLOAT
          Result should be float.
static int INTEGER
          Result should be integer.
static int LONG
          Result should be long.
static int NUMERIC
          The result should be numeric.
static int SHORT
          Result should be short.
 
Fields inherited from class pl.kernelpanic.dbmonster.generator.BasicDataGenerator
column, nulls
 
Constructor Summary
NumberGenerator()
           
 
Method Summary
 Object generate()
          Generates random number.
 String getMaxValue()
          Returns maximal value.
 String getMinValue()
          Returns minimal value.
 String getReturnedType()
          Returns type.
 int getScale()
          Returns scale.
 void initialize(DBMonsterContext ctx)
          Initializes the generator.
 void reset()
          Resets the generator.
 void setMaxValue(String maxVal)
          Maximum value.
 void setMinValue(String minVal)
          Minimal value.
 void setReturnedType(String type)
          Sets the returned type.
 void setScale(int s)
          Sets the scale.
 
Methods inherited from class pl.kernelpanic.dbmonster.generator.BasicDataGenerator
getColumn, getNulls, setColumn, setNulls
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHORT

public static final int SHORT
Result should be short.

See Also:
Constant Field Values

INTEGER

public static final int INTEGER
Result should be integer.

See Also:
Constant Field Values

LONG

public static final int LONG
Result should be long.

See Also:
Constant Field Values

FLOAT

public static final int FLOAT
Result should be float.

See Also:
Constant Field Values

DOUBLE

public static final int DOUBLE
Result should be double.

See Also:
Constant Field Values

NUMERIC

public static final int NUMERIC
The result should be numeric.

See Also:
Constant Field Values
Constructor Detail

NumberGenerator

public NumberGenerator()
Method Detail

initialize

public final void initialize(DBMonsterContext ctx)
                      throws Exception
Initializes the generator.

Specified by:
initialize in interface Initializable
Parameters:
ctx - context
Throws:
Exception - if generator contains errors.

generate

public final Object generate()
Generates random number.

Specified by:
generate in interface DataGenerator
Returns:
number

getMinValue

public final String getMinValue()
Returns minimal value.

Returns:
minimal value

setMinValue

public final void setMinValue(String minVal)
Minimal value.

Parameters:
minVal - minimal value

getMaxValue

public final String getMaxValue()
Returns maximal value.

Returns:
maximal value

setMaxValue

public final void setMaxValue(String maxVal)
Maximum value.

Parameters:
maxVal - maximum value

getScale

public final int getScale()
Returns scale.

Returns:
number of fraction digits

setScale

public final void setScale(int s)
Sets the scale.

Parameters:
s - number of fraction digits

getReturnedType

public final String getReturnedType()
Returns type.

Returns:
string representation of returned time

setReturnedType

public final void setReturnedType(String type)
Sets the returned type.

Parameters:
type - type

reset

public void reset()
Description copied from interface: DataGenerator
Resets the generator.

Specified by:
reset in interface DataGenerator
See Also:
DataGenerator.reset()


Copyright © 2003-2005 .:. kernelpanic.pl .:.. All Rights Reserved.