Class ParameterFactory
java.lang.Object
gov.nih.mipav.model.scripting.parameters.ParameterFactory
Factory methods for the creation of various types of Parameters.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final ParameterBooleannewBoolean(String label, boolean value) Creates a new boolean parameter with a given label and value.static final ParameterDoubleCreates a new double precision parameter with a given label and value.protected static final ParameterExternalImagenewExternalImage(String label, String value) Creates a new externally-specified image placeholder variable parameter with a given label and value (e.g., '$image1').static final ParameterFileCreates a new file parameter with a given label and value.static final ParameterFloatCreates a new floating point parameter with a given label and value.protected static final ParameterImageCreates a new image placeholder variable parameter with a given label and value (e.g., '$image1').static final ParameterImageCreates a new image placeholder variable parameter with a given label and value (e.g., '$image1').static final ParameterIntCreates a new integer parameter with a given label and value.static final ParameterLongCreates a new long integer parameter with a given label and value.static final ParameternewNonListParameter(String label, int type, String value) Creates a new parameter with a given label and value.static final ParameternewParameter(String label, boolean value) Creates a new boolean parameter with a given label and value.static final ParameternewParameter(String label, boolean[] values) Creates a new ParameterList of ParameterBooleans from an array of booleans.static final ParameternewParameter(String label, double value) Creates a new double precision parameter with a given label and value.static final ParameternewParameter(String label, double[] values) Creates a new ParameterList of ParameterFloats from an array of doubles.static final ParameternewParameter(String label, float value) Creates a new floating point parameter with a given label and value.static final ParameternewParameter(String label, float[] values) Creates a new ParameterList of ParameterFloats from an array of floats.static final ParameternewParameter(String label, int value) Creates a new integer parameter with a given label and value.static final ParameternewParameter(String label, int[] values) Creates a new ParameterList of ParameterInts from an array of ints.static final ParameternewParameter(String label, long value) Creates a new long integer parameter with a given label and value.static final ParameternewParameter(String label, short value) Creates a new signed short parameter with a given label and value.static final ParameternewParameter(String label, Object value) Creates a new parameter with a given label and value.static final ParameternewParameter(String label, Object[] value_arr) Creates a new parameter with a given label and value.static final ParameternewParameter(String label, String value) Creates a new string parameter with a given label and value.static final ParameterShortCreates a new signed short parameter with a given label and value.static final ParameterStringCreates a new string parameter with a given label and value.static final ParameterUShortCreates a new unsigned short parameter with a given label and value.static final ParameterparseParameter(String label, String type, String value) Creates a new parameter with a given label and value.
-
Constructor Details
-
ParameterFactory
public ParameterFactory()
-
-
Method Details
-
newBoolean
Creates a new boolean parameter with a given label and value.- Parameters:
label- The label/name of the new parameter.value- The value to assign to the new parameter.- Returns:
- A new boolean parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newDouble
Creates a new double precision parameter with a given label and value.- Parameters:
label- The label/name of the new parameter.value- The value to assign to the new parameter.- Returns:
- A new double parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newFile
Creates a new file parameter with a given label and value.- Parameters:
label- The label/name of the new parameter.value- The value to assign to the new parameter.- Returns:
- A new file parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newFloat
Creates a new floating point parameter with a given label and value.- Parameters:
label- The label/name of the new parameter.value- The value to assign to the new parameter.- Returns:
- A new float parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newImage
public static final ParameterImage newImage(String label, String value, boolean isExternalImage) throws ParserException Creates a new image placeholder variable parameter with a given label and value (e.g., '$image1').- Parameters:
label- The label/name of the new parameter.value- The value to assign to the new parameter (e.g., '$image1').isExternalImage- Whether the new image needs to be externally-specified (as opposed to generated from within the script).- Returns:
- A new image placeholder variable parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newInt
Creates a new integer parameter with a given label and value.- Parameters:
label- The label/name of the new parameter.value- The value to assign to the new parameter.- Returns:
- A new integer parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newLong
Creates a new long integer parameter with a given label and value.- Parameters:
label- The label/name of the new parameter.value- The value to assign to the new parameter.- Returns:
- A new long parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newNonListParameter
public static final Parameter newNonListParameter(String label, int type, String value) throws ParserException Creates a new parameter with a given label and value. The type of parameter returned is determined by the type given. List parameters are not supported by this method.- Parameters:
label- The label/name of the new parameter.type- The type of parameter to create (PARAM_LIST is not supported through this method, use the othernewParameter()).value- The value to assign to the new parameter in String form (to be parsed according to the parameter type).- Returns:
- A new parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.- See Also:
-
newParameter
Creates a new double precision parameter with a given label and value.- Parameters:
label- The label/name of the new parameter.value- The value to assign to the new parameter.- Returns:
- A new double parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newParameter
Creates a new floating point parameter with a given label and value.- Parameters:
label- The label/name of the new parameter.value- The value to assign to the new parameter.- Returns:
- A new float parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newParameter
Creates a new long integer parameter with a given label and value.- Parameters:
label- The label/name of the new parameter.value- The value to assign to the new parameter.- Returns:
- A new long parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newParameter
Creates a new integer parameter with a given label and value.- Parameters:
label- The label/name of the new parameter.value- The value to assign to the new parameter.- Returns:
- A new integer parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newParameter
Creates a new signed short parameter with a given label and value.- Parameters:
label- The label/name of the new parameter.value- The value to assign to the new parameter.- Returns:
- A new short parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newParameter
Creates a new boolean parameter with a given label and value.- Parameters:
label- The label/name of the new parameter.value- The value to assign to the new parameter.- Returns:
- A new boolean parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newParameter
Creates a new string parameter with a given label and value.- Parameters:
label- The label/name of the new parameter.value- The value to assign to the new parameter.- Returns:
- A new string parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newParameter
Creates a new ParameterList of ParameterBooleans from an array of booleans.- Parameters:
label- The label/name of the new parameter.values- The array of booleans to put into the parameter list.- Returns:
- A new list parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newParameter
Creates a new ParameterList of ParameterFloats from an array of floats.- Parameters:
label- The label/name of the new parameter.values- The array of floats to put into the parameter list.- Returns:
- A new list parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newParameter
Creates a new ParameterList of ParameterInts from an array of ints.- Parameters:
label- The label/name of the new parameter.values- The array of ints to put into the parameter list.- Returns:
- A new list parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newParameter
Creates a new ParameterList of ParameterFloats from an array of doubles.- Parameters:
label- The label/name of the new parameter.values- The array of doubles to put into the parameter list.- Returns:
- A new list parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newParameter
Creates a new parameter with a given label and value. The parameter type is determined by the type of the value passed in.- Parameters:
label- The label/name of the new parameter.value_arr- The array of values to assign to the new parameter. Must be an array of boxed primitive types or Strings- Returns:
- A new parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newParameter
Creates a new parameter with a given label and value. The parameter type is determined by the type of the value passed in.- Parameters:
label- The label/name of the new parameter.value- The value to assign to the new parameter. Should be the of the type object associated with a primitive type, or String.- Returns:
- A new parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newShort
Creates a new signed short parameter with a given label and value.- Parameters:
label- The label/name of the new parameter.value- The value to assign to the new parameter.- Returns:
- A new short parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newString
Creates a new string parameter with a given label and value.- Parameters:
label- The label/name of the new parameter.value- The value to assign to the new parameter.- Returns:
- A new string parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newUShort
Creates a new unsigned short parameter with a given label and value.- Parameters:
label- The label/name of the new parameter.value- The value to assign to the new parameter.- Returns:
- A new unsigned short parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
parseParameter
public static final Parameter parseParameter(String label, String type, String value) throws ParserException Creates a new parameter with a given label and value. This method is used to create parameters from the strings read in as part of a script line.- Parameters:
label- The label/name of the new parameter.type- A String indicating the type of the new parameter to create.value- The value to assign to the new parameter in String form (to be parsed according to the parameter type).- Returns:
- A new parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.- See Also:
-
newExternalImage
protected static final ParameterExternalImage newExternalImage(String label, String value) throws ParserException Creates a new externally-specified image placeholder variable parameter with a given label and value (e.g., '$image1').- Parameters:
label- The label/name of the new parameter.value- The value to assign to the new parameter.- Returns:
- A new image placeholder variable parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-
newImage
Creates a new image placeholder variable parameter with a given label and value (e.g., '$image1').- Parameters:
label- The label/name of the new parameter.value- The value to assign to the new parameter.- Returns:
- A new image placeholder variable parameter.
- Throws:
ParserException- If there is a problem creating the new parameter.
-