uk.ac.imperial.ph.hep.command.impl
Class DaqCmdParamSimple

java.lang.Object
  extended by uk.ac.imperial.ph.hep.command.impl.DaqCmdParamSimple
All Implemented Interfaces:
DaqCmdParam, DaqCmdParamOption

public class DaqCmdParamSimple
extends java.lang.Object
implements DaqCmdParamOption


Nested Class Summary
 
Nested classes/interfaces inherited from interface uk.ac.imperial.ph.hep.command.DaqCmdParamOption
DaqCmdParamOption.Type
 
Constructor Summary
DaqCmdParamSimple(java.lang.String defaultP, boolean oneParamOnly, DaqCmdParamOption.Type type, java.lang.String[] defVals, java.lang.String desc)
           
DaqCmdParamSimple(java.lang.String defaultP, DaqCmdParamOption.Type type, java.lang.String defVal, java.lang.String desc)
           
 
Method Summary
 java.lang.String getDescription()
           
 java.lang.String getExecString()
          Returns the string to append to the executable.
 DaqCmdParamOption.Type getOptType()
          Returns one of the bytes in this interface defining what type of option value is expected.
 boolean isEnabled()
          Returns true if this parameter is enabled.
 boolean isUnaltered()
           
 boolean oneOptOnly()
          Returns true if this parameter may only have one option value, so the length of the array passed to setOptValue may be no longer than one.
 void reset()
          Reinitialise the paramter, and reenable it.
 void setEnabled(boolean enabled)
          Call this passing in false if you want the parameter to be ignored.
 void setOff()
          Sets this parameter to be its default value.
 void setOn()
          Sets this parameter to be its non-default value.
 void setOptValues(java.lang.String[] val)
          Set the option values to be appended to the initial parameter flag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DaqCmdParamSimple

public DaqCmdParamSimple(java.lang.String defaultP,
                         boolean oneParamOnly,
                         DaqCmdParamOption.Type type,
                         java.lang.String[] defVals,
                         java.lang.String desc)

DaqCmdParamSimple

public DaqCmdParamSimple(java.lang.String defaultP,
                         DaqCmdParamOption.Type type,
                         java.lang.String defVal,
                         java.lang.String desc)
Method Detail

getOptType

public DaqCmdParamOption.Type getOptType()
Description copied from interface: DaqCmdParamOption
Returns one of the bytes in this interface defining what type of option value is expected.

Specified by:
getOptType in interface DaqCmdParamOption
Returns:

oneOptOnly

public boolean oneOptOnly()
Description copied from interface: DaqCmdParamOption
Returns true if this parameter may only have one option value, so the length of the array passed to setOptValue may be no longer than one.

Specified by:
oneOptOnly in interface DaqCmdParamOption
Returns:

setOptValues

public void setOptValues(java.lang.String[] val)
                  throws DaqBadParameterException
Description copied from interface: DaqCmdParamOption
Set the option values to be appended to the initial parameter flag. Throws a runtime DaqBadParameterException if one of the option values is bad.

Specified by:
setOptValues in interface DaqCmdParamOption
Throws:
DaqBadParameterException

getExecString

public java.lang.String getExecString()
Returns the string to append to the executable. Returns "" if this parameter is turned off.

Specified by:
getExecString in interface DaqCmdParam
Returns:
the string the parameter would append.

isUnaltered

public boolean isUnaltered()
Specified by:
isUnaltered in interface DaqCmdParam
Returns:
true if the parameter has not altered from its original default state.

reset

public void reset()
Description copied from interface: DaqCmdParam
Reinitialise the paramter, and reenable it.

Specified by:
reset in interface DaqCmdParam

setOff

public void setOff()
Description copied from interface: DaqCmdParam
Sets this parameter to be its default value.

Specified by:
setOff in interface DaqCmdParam

setOn

public void setOn()
Description copied from interface: DaqCmdParam
Sets this parameter to be its non-default value.

Specified by:
setOn in interface DaqCmdParam

isEnabled

public boolean isEnabled()
Description copied from interface: DaqCmdParam
Returns true if this parameter is enabled.

Specified by:
isEnabled in interface DaqCmdParam
Returns:

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: DaqCmdParam
Call this passing in false if you want the parameter to be ignored.

Specified by:
setEnabled in interface DaqCmdParam

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface DaqCmdParam
Returns:
a short one-line description of what this parameter does.