|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.slamd.example.NumericRange
public class NumericRange
This class defines a data structure for representing a numeric range. The range can select values seuqentially or at random, in increasing or decreasing order and with varying increments.
| Constructor Summary | |
|---|---|
NumericRange(int lowerBound,
int upperBound,
boolean sequential,
int increment,
java.util.Random random,
java.text.NumberFormat format)
Creates a new numeric range with the provided information. |
|
NumericRange(java.lang.String valueString)
Creates a new numeric range that will always returned. |
|
| Method Summary | |
|---|---|
int |
getLowerBound()
Retrieves the lower bound for this numeric range. |
int |
getSequentialIncrement()
Retrieves the sequential increment that will be used for this numeric range. |
java.lang.String |
getStringValue()
Retrieves the string value for this element. |
int |
getUpperBound()
Retrieves the upper bound for this numeric range. |
boolean |
isNumeric()
Indicates whether the value of this element is numeric or a string. |
boolean |
isSequential()
Indicates whether the numeric range is configured to select values in sequential order or at random. |
void |
nextValue(java.lang.StringBuffer buffer)
Appends the next value in the range to the provided buffer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NumericRange(int lowerBound,
int upperBound,
boolean sequential,
int increment,
java.util.Random random,
java.text.NumberFormat format)
lowerBound - The lower bound to use for the range.upperBound - The upper bound to use for the range.sequential - Indicates whether to iterate through the values in
sequential order or at random.increment - The increment to use for iterating through the values
in sequential order.random - The random number generator to use to construct the
random values.format - The number formatter to use if special formatting is
required for the value. It may be null if
no special formatting is required.public NumericRange(java.lang.String valueString)
valueString - The value string to use instead of a numeric range.| Method Detail |
|---|
public void nextValue(java.lang.StringBuffer buffer)
buffer - The buffer to which the value should be appended.public boolean isNumeric()
true if this element is numeric, or
false if the value is a string.public boolean isSequential()
isNumeric returns true.
true if the values are chosen in sequential order, or
false if they are random.public int getLowerBound()
isNumeric returns
true.
public int getUpperBound()
isNumeric returns
true.
public int getSequentialIncrement()
isNumeric and isSequential return
true.
public java.lang.String getStringValue()
isNumeric returns false.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||