edu.jhu.ece.iacl.jist.pipeline.parameter
Class ParamSwitch

java.lang.Object
  extended by edu.jhu.ece.iacl.jist.pipeline.PipePort<T>
      extended by edu.jhu.ece.iacl.jist.pipeline.parameter.ParamModel<T>
          extended by edu.jhu.ece.iacl.jist.pipeline.parameter.ParamHidden<java.lang.String>
              extended by edu.jhu.ece.iacl.jist.pipeline.parameter.ParamSwitch
All Implemented Interfaces:
JISTInternalParam, java.lang.Cloneable, java.lang.Comparable<ParamModel>

public class ParamSwitch
extends ParamHidden<java.lang.String>
implements JISTInternalParam

Command line switch parameter.

Author:
Blake Lucas (bclucas@jhu.edu)

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.jhu.ece.iacl.jist.pipeline.PipePort
PipePort.PortListener, PipePort.type
 
Field Summary
protected  boolean switchSpaced
          The switch spaced.
protected  java.lang.String switchString
          The switch string.
 
Fields inherited from class edu.jhu.ece.iacl.jist.pipeline.parameter.ParamModel
cliTag, description, factory, hidden, label, loadAndSaveOnValidate, mandatory, shortLabel
 
Fields inherited from class edu.jhu.ece.iacl.jist.pipeline.PipePort
connectible, gport, incomingConnectors, listeners, maxIncoming, maxOutgoing, outgoingConnectors, owner, portType, useWire
 
Constructor Summary
ParamSwitch()
          Default constructor.
ParamSwitch(java.lang.String name, java.lang.String switchString)
          Constructor.
ParamSwitch(java.lang.String name, java.lang.String switchString, boolean switchSpaced)
          Constructor.
 
Method Summary
 ParamSwitch clone()
          Clone object.
 int compareTo(ParamModel obj)
          Compare specificity of parameters.
 java.lang.String getHumanReadableDataType()
           
 java.lang.String getValue()
          Get switch string.
 java.lang.String getXMLValue()
           
 void init()
          Initialize parameter.
 boolean isSwitchSpaced()
          Returns true if there is a space after the switch.
 java.lang.String probeDefaultValue()
           
 void setSwitchSpaced(boolean switchSpaced)
          Indicates whether there should be a space after the switch.
 void setValue(java.lang.String value)
          Set switch string.
 void setXMLValue(java.lang.String arg)
           
 java.lang.String toString()
          Get switch description.
 void validate()
          Unimplemented.
 
Methods inherited from class edu.jhu.ece.iacl.jist.pipeline.parameter.ParamHidden
isHidden
 
Methods inherited from class edu.jhu.ece.iacl.jist.pipeline.parameter.ParamModel
clean, createMipavParameter, createTreeNode, dispose, equals, getCliTag, getDescription, getFactory, getInputView, getLabel, getName, getOutputView, getShortLabel, getView, hide, importMipavParameter, importParameter, isCompatible, isConnectible, isMandatory, loadResources, loadResources, read, read, replacePath, saveResources, setCliTag, setDescription, setFactory, setHidden, setInputView, setLabel, setLoadAndSaveOnValidate, setMandatory, setName, setOutputView, setShortLabel, toXML, write, write, writeAndFreeNow
 
Methods inherited from class edu.jhu.ece.iacl.jist.pipeline.PipePort
addListener, disconnect, disconnect, disconnect, disconnect, getGraphPort, getIncomingConnector, getIncomingConnectors, getIncomingPorts, getListeners, getMaxIncoming, getMaxOutgoing, getOutgoingConnector, getOutgoingConnectors, getOutgoingPorts, getOwner, getPortType, isConnected, isConnectedTo, isInputPort, isOutputPort, notifyListenersOfConnection, notifyListenersOfDisconnection, removeAllListeners, removeListener, setConnectable, setGraphPort, setMaxIncoming, setMaxOutgoing, setOwner, setPortType, setUseConnector, usingConnector
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

switchString

protected java.lang.String switchString
The switch string.


switchSpaced

protected boolean switchSpaced
The switch spaced.

Constructor Detail

ParamSwitch

public ParamSwitch()
Default constructor.


ParamSwitch

public ParamSwitch(java.lang.String name,
                   java.lang.String switchString)
Constructor.

Parameters:
name - parameter name
switchString - switch string

ParamSwitch

public ParamSwitch(java.lang.String name,
                   java.lang.String switchString,
                   boolean switchSpaced)
Constructor.

Parameters:
name - parameter name
switchString - switch string
switchSpaced - flag to indicate whether to put a space after switch
Method Detail

clone

public ParamSwitch clone()
Clone object.

Specified by:
clone in class ParamModel<java.lang.String>
Returns:
the param switch

compareTo

public int compareTo(ParamModel obj)
Description copied from class: ParamModel
Compare specificity of parameters. Zero indicates both parameters have the same level of specificity. Negative one indicates this parameter is less specific than the foreign one. Positive one indicates this parameter is more specific than the foreign one.

Specified by:
compareTo in interface java.lang.Comparable<ParamModel>
Overrides:
compareTo in class ParamModel<java.lang.String>
Parameters:
obj - the mod
Returns:
the int

getValue

public java.lang.String getValue()
Get switch string.

Specified by:
getValue in class ParamModel<java.lang.String>
Returns:
the value

init

public void init()
Initialize parameter.

Overrides:
init in class ParamHidden<java.lang.String>

isSwitchSpaced

public boolean isSwitchSpaced()
Returns true if there is a space after the switch.

Returns:
true if spaced

setSwitchSpaced

public void setSwitchSpaced(boolean switchSpaced)
Indicates whether there should be a space after the switch.

Parameters:
switchSpaced - true if spaced

setValue

public void setValue(java.lang.String value)
              throws InvalidParameterValueException
Set switch string.

Specified by:
setValue in class ParamModel<java.lang.String>
Parameters:
value - the value
Throws:
InvalidParameterValueException - the invalid parameter value exception

toString

public java.lang.String toString()
Get switch description.

Specified by:
toString in class ParamModel<java.lang.String>
Returns:
the string

validate

public void validate()
              throws InvalidParameterException
Unimplemented.

Specified by:
validate in class ParamModel<java.lang.String>
Throws:
InvalidParameterException - the invalid parameter exception

getHumanReadableDataType

public java.lang.String getHumanReadableDataType()
Specified by:
getHumanReadableDataType in class ParamModel<java.lang.String>

getXMLValue

public java.lang.String getXMLValue()
Specified by:
getXMLValue in class ParamModel<java.lang.String>

setXMLValue

public void setXMLValue(java.lang.String arg)
Specified by:
setXMLValue in class ParamModel<java.lang.String>

probeDefaultValue

public java.lang.String probeDefaultValue()
Specified by:
probeDefaultValue in class ParamModel<java.lang.String>