Class ParameterUShort
- java.lang.Object
-
- gov.nih.mipav.model.scripting.parameters.Parameter
-
- gov.nih.mipav.model.scripting.parameters.ParameterUShort
-
public class ParameterUShort extends Parameter
A unsigned short parameter used in either the recording or execution of a script action.
-
-
Field Summary
Fields Modifier and Type Field Description private short
value
The parameter's value.-
Fields inherited from class gov.nih.mipav.model.scripting.parameters.Parameter
PARAM_BOOLEAN, PARAM_DOUBLE, PARAM_EXTERNAL_IMAGE, PARAM_FILE, PARAM_FLOAT, PARAM_IMAGE, PARAM_INT, PARAM_LIST, PARAM_LONG, PARAM_SHORT, PARAM_STRING, PARAM_USHORT
-
-
Constructor Summary
Constructors Constructor Description ParameterUShort(java.lang.String paramLabel)
Creates a new ParameterUShort object without any value.ParameterUShort(java.lang.String paramLabel, int paramType, short paramValue)
Creates a new ParameterUShort object.ParameterUShort(java.lang.String paramLabel, int paramType, java.lang.String paramValueString)
Creates a new ParameterUShort object.ParameterUShort(java.lang.String paramLabel, short paramValue)
Creates a new ParameterUShort with a new value.ParameterUShort(java.lang.String paramLabel, java.lang.String paramTypeString, short paramValue)
Creates a new ParameterUShort object.ParameterUShort(java.lang.String paramLabel, java.lang.String paramTypeString, java.lang.String paramValueString)
Creates a new ParameterUShort object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description short
getValue()
Returns the parameter value.java.lang.String
getValueString()
Returns the parameter value as a string.boolean
isValueValid(short paramValue)
Checks whether a prospective value is valid.void
setValue(short paramValue)
Changes the parameter's current value.void
setValue(java.lang.String paramValueString)
Changes the parameter's current value.-
Methods inherited from class gov.nih.mipav.model.scripting.parameters.Parameter
convertToString, getLabel, getParent, getParentConditionValueString, getType, getTypeFromString, getTypeString, getTypeString, isOptional, isParentConditionValueMet, isValueAssigned, setOptional, setParent, setParentCondition, setParentConditionValue, setValueAssigned
-
-
-
-
Constructor Detail
-
ParameterUShort
public ParameterUShort(java.lang.String paramLabel) throws ParserException
Creates a new ParameterUShort object without any value.- Parameters:
paramLabel
- The label/name to give to this parameter.- Throws:
ParserException
- If there is a problem creating the parameter.
-
ParameterUShort
public ParameterUShort(java.lang.String paramLabel, short paramValue) throws ParserException
Creates a new ParameterUShort with a new value.- Parameters:
paramLabel
- The label/name to give to this parameter.paramValue
- The new parameter value.- Throws:
ParserException
- If there is a problem creating the parameter.
-
ParameterUShort
public ParameterUShort(java.lang.String paramLabel, java.lang.String paramTypeString, short paramValue) throws ParserException
Creates a new ParameterUShort object.- Parameters:
paramLabel
- The label/name to give to this parameter.paramTypeString
- The type of this parameter, in string form.paramValue
- The new parameter value.- Throws:
ParserException
- If there is a problem creating the parameter (e.g., a value less than 0).
-
ParameterUShort
public ParameterUShort(java.lang.String paramLabel, java.lang.String paramTypeString, java.lang.String paramValueString) throws ParserException
Creates a new ParameterUShort object.- Parameters:
paramLabel
- The label/name to give to this parameter.paramTypeString
- The type of this parameter, in string form.paramValueString
- The new parameter value in string form.- Throws:
ParserException
- If there is a problem creating the parameter (e.g., a value less than 0).
-
ParameterUShort
public ParameterUShort(java.lang.String paramLabel, int paramType, short paramValue) throws ParserException
Creates a new ParameterUShort object.- Parameters:
paramLabel
- The label/name to give to this parameter.paramType
- The type of this parameter (should be PARAM_USHORT).paramValue
- The new parameter value.- Throws:
ParserException
- If there is a problem creating the parameter (e.g., a value less than 0).
-
ParameterUShort
public ParameterUShort(java.lang.String paramLabel, int paramType, java.lang.String paramValueString) throws ParserException
Creates a new ParameterUShort object.- Parameters:
paramLabel
- The label/name to give to this parameter.paramType
- The type of this parameter (should be PARAM_USHORT).paramValueString
- The new parameter value in string form.- Throws:
ParserException
- If there is a problem creating the parameter (e.g., a value less than 0).
-
-
Method Detail
-
getValue
public short getValue()
Returns the parameter value.- Returns:
- The parameter value.
-
getValueString
public java.lang.String getValueString()
Returns the parameter value as a string.- Specified by:
getValueString
in classParameter
- Returns:
- The parameter value in string form.
-
isValueValid
public boolean isValueValid(short paramValue) throws ParserException
Checks whether a prospective value is valid.- Parameters:
paramValue
- A prospective unsigned short value.- Returns:
True
if the value is valid,false
otherwise.- Throws:
ParserException
- If the given value is not valid (if < 0).
-
setValue
public void setValue(java.lang.String paramValueString) throws ParserException
Changes the parameter's current value.- Specified by:
setValue
in classParameter
- Parameters:
paramValueString
- The new parameter value in String form.- Throws:
ParserException
- If there is a problem changing the parameter value (< 0).
-
setValue
public void setValue(short paramValue) throws ParserException
Changes the parameter's current value.- Parameters:
paramValue
- The new parameter value.- Throws:
ParserException
- If there is a problem changing the parameter value (< 0).
-
-