edu.usc.cse.desi.generate
Class InputData

java.lang.Object
  extended byedu.usc.cse.desi.generate.InputData

public class InputData
extends java.lang.Object

This class is called InputData because in many ways its functionality is similar to that of the InputData class in DeSi 1.0. It's job is to hold the data needed to generate a new system. At its heart are two mappings (Min & Max) from property names to Text boxes. Because all of the properties are specified synamically, this InputData must store the TextBox widgets that are created. Then when it is time for a simulation to be generated, it can go back to all of those widgets and get the values that the user has typed in.

Author:
NeLs Started on Jul 30, 2004

Field Summary
private  org.eclipse.swt.widgets.Text myLevelOfDisconnect
           
private  java.util.HashMap myMaxValues
           
private  java.util.HashMap myMinValues
           
private  org.eclipse.swt.widgets.Text myNumComps
           
private  org.eclipse.swt.widgets.Text myNumHosts
           
 
Constructor Summary
InputData()
           
 
Method Summary
 void addMaxWidget(java.lang.String prop_name, org.eclipse.swt.widgets.Text text_box)
          This method will associate a given Text widget with the given property name as being a Max value for that property.
 void addMinWidget(java.lang.String prop_name, org.eclipse.swt.widgets.Text text_box)
           
 double getLevelOfDisconnect()
          Return the level of host disconnect as entered into the widget by the user.
 java.lang.String getMaxValue(java.lang.String prop_name)
          Returns the Max value, in String form, for the given property as entered by the user.
 java.lang.String getMinValue(java.lang.String prop_name)
           
 int getNumComps()
           
 int getNumHosts()
          Returns the number of hosts for the new system as specified in the Number of Hosts Text box.
 void setLevelOfDisconnectWidget(org.eclipse.swt.widgets.Text widget)
          This method will store the widget that holds the user input for the level of host disconnect.
 void setNumCompsWidget(org.eclipse.swt.widgets.Text text_box)
           
 void setNumHostWidget(org.eclipse.swt.widgets.Text text_box)
          This object will hold on to a reference to the Number of Hosts text box so that when it's time to generate a sytem, it will read what the user has typed in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myMinValues

private java.util.HashMap myMinValues

myMaxValues

private java.util.HashMap myMaxValues

myNumHosts

private org.eclipse.swt.widgets.Text myNumHosts

myNumComps

private org.eclipse.swt.widgets.Text myNumComps

myLevelOfDisconnect

private org.eclipse.swt.widgets.Text myLevelOfDisconnect
Constructor Detail

InputData

public InputData()
Method Detail

addMaxWidget

public void addMaxWidget(java.lang.String prop_name,
                         org.eclipse.swt.widgets.Text text_box)
This method will associate a given Text widget with the given property name as being a Max value for that property. From the Text widget, we can later find out what the user typed in for that particular value.

Parameters:
prop_name -
text_box -

addMinWidget

public void addMinWidget(java.lang.String prop_name,
                         org.eclipse.swt.widgets.Text text_box)
Parameters:
prop_name -
text_box -
See Also:
addMaxWidget(String, Text)

setLevelOfDisconnectWidget

public void setLevelOfDisconnectWidget(org.eclipse.swt.widgets.Text widget)
This method will store the widget that holds the user input for the level of host disconnect.

Parameters:
widget - Text - The widget.

setNumHostWidget

public void setNumHostWidget(org.eclipse.swt.widgets.Text text_box)
This object will hold on to a reference to the Number of Hosts text box so that when it's time to generate a sytem, it will read what the user has typed in.

Parameters:
text_box -

setNumCompsWidget

public void setNumCompsWidget(org.eclipse.swt.widgets.Text text_box)
Parameters:
text_box -
See Also:
setNumHostWidget(Text)

getNumHosts

public int getNumHosts()
                throws java.lang.NumberFormatException
Returns the number of hosts for the new system as specified in the Number of Hosts Text box.

Returns:
int - The number of hosts to be created.
Throws:
java.lang.NumberFormatException - This exception is thrown if an invalid string is entered into field.

getNumComps

public int getNumComps()
                throws java.lang.NumberFormatException
Returns:
Throws:
java.lang.NumberFormatException
See Also:
getNumHosts()

getLevelOfDisconnect

public double getLevelOfDisconnect()
                            throws java.lang.NumberFormatException
Return the level of host disconnect as entered into the widget by the user.

Returns:
Throws:
java.lang.NumberFormatException

getMinValue

public java.lang.String getMinValue(java.lang.String prop_name)
Parameters:
prop_name -
Returns:
See Also:
getMinValue(String)

getMaxValue

public java.lang.String getMaxValue(java.lang.String prop_name)
Returns the Max value, in String form, for the given property as entered by the user. String could be invalid or not a number, etc.

Parameters:
prop_name -
Returns: