org.openware.loadsim.link
Class DataSet

java.lang.Object
  |
  +--org.openware.loadsim.link.DataSet
All Implemented Interfaces:
java.io.Serializable

public class DataSet
extends java.lang.Object
implements java.io.Serializable

The Simulation's internal representation of a DataSet. DataSets store a list of values that can be used during the simulation. At configuration time you can specify 1 of 2 ways to iterate through the DataSet during the simulation:

  1. Randomly by setting the 'itertype' attribute to 'random'. If you choose this type the values specified in the dataset will be returned by randomly picking from the list.
  2. Iterate through the list in a round robbin way by, starting with the first one in the list and going through in order. Once the end of the list is reached we start over at the beginning.

Author:
Vincent Sheffer
See Also:
Serialized Form

Field Summary
static int RANDOM
           
static int ROUND
           
 
Constructor Summary
DataSet(org.w3c.dom.Node node)
          Create a DataSet from the data contained in the DOM node.
 
Method Summary
 DataSet deepCopy()
           
 java.lang.String getId()
          Get the id for the dataset.
 java.lang.String nextValue()
          Get the next value for the dataset.
 void reset()
          Reset the dataset.
 void setNextValue(int nextValue)
           
 void setStepValue(int stepValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RANDOM

public static final int RANDOM

ROUND

public static final int ROUND
Constructor Detail

DataSet

public DataSet(org.w3c.dom.Node node)
        throws ConfigException
Create a DataSet from the data contained in the DOM node.
Parameters:
node - The DOM node that is pointing at dataset XML element.
Throws:
ConfigExcpetion - If there are any errors in the configuration file for the dataset.
Method Detail

deepCopy

public DataSet deepCopy()

reset

public void reset()
Reset the dataset. If the iteration type is ROUND this will set the next value to be the first one defined in the configuration file. If the iteration type is RANDOM then this is call is effectively ignored.

nextValue

public java.lang.String nextValue()
Get the next value for the dataset. How the next value is determined is based on the interation type for the dataset.

If it is a RANDOM iteration type then a value from the dataset is chosen randomly. If the iteration type is ROUND then the values are sequenced in the order they are specified in the configuration file and after the last one has been returned the next value will be the beginning of the dataset. The values are "round-robin'ed" in this way for the duration of the simulation.

Returns:
The next value for the dataset.

getId

public java.lang.String getId()
Get the id for the dataset. The id is used to reference this DataSet object.
Returns:
The DataSet's id.

setStepValue

public void setStepValue(int stepValue)

setNextValue

public void setNextValue(int nextValue)


Copyright © 2000, 2001 Openware, Spin Software. All Rights Reserved.