jetweb is hosted by Hepforge, IPPP Durham

cedar.jetweb.model.plots
Class PlotSwitch

java.lang.Object
  extended by cedar.jetweb.model.plots.PlotSwitch
All Implemented Interfaces:
Storeable

public class PlotSwitch
extends java.lang.Object
implements Storeable

Switch which tells JetWeb which process a plot should be generated by under various conditions

Version:
$Date: 2006-05-02 21:23:13 +0100 (Tue, 02 May 2006) $
Author:
Jon Butterworth, UCL.

Constructor Summary
PlotSwitch()
          Create an empty plotSwitch
PlotSwitch(int newId)
          Create a plotSwitch based on an ID
 
Method Summary
static MCProcessType defaultProc(Collision c)
           
 boolean equals(java.lang.Object obj)
          Override the Object equals method.
static java.util.Iterator<java.lang.String> getAllowedParameters()
          Return an enumeration of all the parameter names which will be understood by the switching infrastructure.
 java.lang.String getGeneratorName()
          Return the generator name for which this works
 double getGeneratorVersion()
          Return the generator name for which this works
 int getId()
          return the id of this switch
 MCProcessType getMCProcessType()
          return processType
 int getMCProcessTypeId()
          return the id of processType
 java.lang.String getParameterName()
          Return the parmater name on which the switching is based
 double getParameterValueHigh()
          Return the parameter value at which switching occurs.
 double getParameterValueLow()
          Return the low parameter value at which switching occurs.
 int getPlotId()
           
 int hashCode()
           
static void initializeParameterList()
          Initialize the list of allowed parameters for switching.
static boolean isAllowedParameter(java.lang.String parameter)
          Return true if the input string matches one of the parameter names which is understood by the switching infrastructure.
 boolean retrieve()
          Populate the object in memory from the database.
 void setGeneratorName(java.lang.String gen)
           
 void setGeneratorVersion(double vers)
           
 void setMCProcessTypeId(int id)
           
 void setParameterName(java.lang.String pname)
           
 void setParameterValueHigh(double val)
           
 void setParameterValueLow(double val)
           
 void setPlotId(int newId)
           
 boolean store()
          Write the object in memory to the database.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlotSwitch

public PlotSwitch(int newId)
           throws JetWebException
Create a plotSwitch based on an ID

Throws:
JetWebException


PlotSwitch

public PlotSwitch()
           throws JetWebException
Create an empty plotSwitch

Throws:
JetWebException

Method Detail

retrieve

public boolean retrieve()
                 throws JetWebException
Description copied from interface: Storeable
Populate the object in memory from the database. Return true if the information retrieved is up to date.

Specified by:
retrieve in interface Storeable
Throws:
JetWebException


store

public boolean store()
              throws JetWebException
Description copied from interface: Storeable
Write the object in memory to the database. If the ID does not exist in the DB the object is inserted as a new entry. If the ID exists, that entry is updated.

Specified by:
store in interface Storeable
Returns:
true if the object was inserted, false otherwise.
Throws:
JetWebException


getId

public int getId()
return the id of this switch

Specified by:
getId in interface Storeable


getMCProcessTypeId

public int getMCProcessTypeId()
return the id of processType


getMCProcessType

public MCProcessType getMCProcessType()
return processType


getGeneratorName

public java.lang.String getGeneratorName()
Return the generator name for which this works


getGeneratorVersion

public double getGeneratorVersion()
Return the generator name for which this works


getParameterValueLow

public double getParameterValueLow()
Return the low parameter value at which switching occurs.


getParameterValueHigh

public double getParameterValueHigh()
Return the parameter value at which switching occurs.


getParameterName

public java.lang.String getParameterName()
Return the parmater name on which the switching is based


setGeneratorName

public void setGeneratorName(java.lang.String gen)

setPlotId

public void setPlotId(int newId)

getPlotId

public int getPlotId()

setGeneratorVersion

public void setGeneratorVersion(double vers)

setParameterName

public void setParameterName(java.lang.String pname)

setParameterValueHigh

public void setParameterValueHigh(double val)

setParameterValueLow

public void setParameterValueLow(double val)

setMCProcessTypeId

public void setMCProcessTypeId(int id)

equals

public boolean equals(java.lang.Object obj)
Override the Object equals method. Two PlotSwitches are equal if their id's are valid and equal. If one or two of the id's are invalid, they are equal if all their fields are equal.

Overrides:
equals in class java.lang.Object


getAllowedParameters

public static java.util.Iterator<java.lang.String> getAllowedParameters()
Return an enumeration of all the parameter names which will be understood by the switching infrastructure.


isAllowedParameter

public static boolean isAllowedParameter(java.lang.String parameter)
Return true if the input string matches one of the parameter names which is understood by the switching infrastructure.


initializeParameterList

public static void initializeParameterList()
Initialize the list of allowed parameters for switching. Currently hardwired but maybe should be done from the properties files eventually?


hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

defaultProc

public static MCProcessType defaultProc(Collision c)