OSFI-Java  3.10.0
OpenSF Integration Library
esa.opensf.osfi.Parameter Class Reference

Classes

enum  ParamComplexType
 
enum  ParamType
 

Public Member Functions

 Parameter (String name, String description, String type, String value)
 
 Parameter (String name, String description, ParamType type, ParamComplexType complexType, String value, String units, String min, String max, List< Integer > dims)
 
 Parameter (String name, String description, ParamType type, ParamComplexType complexType, ArrayNode.Raw rootNode, String units, String min, String max, List< Integer > dims)
 
void write ()
 
boolean isArray ()
 
String getValue ()
 
String getRawValue ()
 
int getIntValue ()
 
double getDoubleValue ()
 
boolean getBooleanValue ()
 
TimeValue getTimeValue ()
 
String getStringValue ()
 
String getFileValue ()
 
int[] getVectorInt ()
 
double[] getVectorDouble ()
 
boolean[] getVectorBoolean ()
 
TimeValue[] getVectorTime ()
 
String[] getVectorString ()
 
String[] getVectorFile ()
 
int[][] getMatrixInt ()
 
double[][] getMatrixDouble ()
 
boolean[][] getMatrixBoolean ()
 
TimeValue[][] getMatrixTime ()
 
String[][] getMatrixString ()
 
String[][] getMatrixFile ()
 
ArrayNode.Raw getRootNode ()
 
boolean[][] fileExist ()
 
void setValue (final String value)
 
int getNdims ()
 
List< Integer > getDims ()
 
String getName ()
 
String getLocalName ()
 
String getPath ()
 
String getDescription ()
 
String getUnits ()
 
String getMax ()
 
String getMin ()
 
String getType ()
 
ParamType getElementType ()
 
String getComplexType ()
 
void addOtherAttribute (final String key, final String val)
 
Map< String, String > getOtherAttributes ()
 
String getOtherAttribute (final String key)
 

Static Public Member Functions

static String getFileFormattedValue (String fileName)
 

Detailed Description

Parameter.
Represents a model's parameter described in a configuration file.

Author
ridr

Constructor & Destructor Documentation

◆ Parameter() [1/3]

esa.opensf.osfi.Parameter.Parameter ( String  name,
String  description,
String  type,
String  value 
)

Constructor for scalar values.

Parameters
nameFull path of the parameter
descriptionOptional description
typeUnparsed form of the element type, as read from the XML. See ParamType.
valueUnparsed form of the value, as read from the XML.

◆ Parameter() [2/3]

esa.opensf.osfi.Parameter.Parameter ( String  name,
String  description,
ParamType  type,
ParamComplexType  complexType,
String  value,
String  units,
String  min,
String  max,
List< Integer >  dims 
)

Constructor for non-array parameters.

Parameters
nameFull path of the parameter
descriptionOptional description
typeElement data type.
complexTypeStructural type. Must not be ParamComplexType#ARRAY for this call.
valueUnparsed form of the value, as read from the XML.
unitsDeclared units of measurement, or empty.
minDeclared minimum value (for types where it makes sense) in unparsed form
maxDeclared maximum value (for types where it makes sense) in unparsed form
dimsExpected dimensions. Empty for a scalar, 1/2 elements for a vector/matrix resp.

◆ Parameter() [3/3]

esa.opensf.osfi.Parameter.Parameter ( String  name,
String  description,
ParamType  type,
ParamComplexType  complexType,
ArrayNode.Raw  rootNode,
String  units,
String  min,
String  max,
List< Integer >  dims 
)

Constructor for ARRAY parameters.

Parameters
nameFull path of the parameter
descriptionOptional description
typeElement data type.
complexTypeStructural type. Must be ParamComplexType#ARRAY.
rootNodeTree structure containing the unparsed data.
unitsDeclared units of measurement, or empty.
minDeclared minimum value (for types where it makes sense) in unparsed form
maxDeclared maximum value (for types where it makes sense) in unparsed form
dimsExpected dimensions. Empty for a scalar, 1/2 elements for a vector/matrix resp.

References esa.opensf.osfi.Parameter.ParamComplexType.ARRAY.

Member Function Documentation

◆ addOtherAttribute()

void esa.opensf.osfi.Parameter.addOtherAttribute ( final String  key,
final String  val 
)

Set an the value of a non-standard parameter attribute.

Parameters
keyattribute name
valattribute value

◆ fileExist()

boolean [][] esa.opensf.osfi.Parameter.fileExist ( )

Checks the existence of the files specified within a FILE parameter.

  • For a scalar, the returned value is a 1x1 matrix, with the result in item
    [0][0]
    .
  • For a vector, the returned value is a 1xN matrix, with the result in the first "row".

Not valid for ARRAY parameters.

Returns
A matrix with a boolean for each slot in this parameter. A true value indicates that the corresponding path is an existing file, while false means that either the path does not exist, or it is not a file.
See also
getMatrixFile()

References esa.opensf.osfi.Parameter.ParamComplexType.ARRAY, esa.opensf.osfi.Logger.error(), esa.opensf.osfi.Parameter.getFileValue(), esa.opensf.osfi.Parameter.getMatrixFile(), and esa.opensf.osfi.Parameter.getVectorFile().

◆ getBooleanValue()

boolean esa.opensf.osfi.Parameter.getBooleanValue ( )
Returns
Parameter value parsed as a boolean, valid only for scalars.

◆ getComplexType()

String esa.opensf.osfi.Parameter.getComplexType ( )
Returns
The complex type of the parameter, or empty for a non-structured parameter.

◆ getDescription()

String esa.opensf.osfi.Parameter.getDescription ( )
Returns
a brief description of the parameter, as provided in the XML.

◆ getDims()

List<Integer> esa.opensf.osfi.Parameter.getDims ( )

Returns the envelope of the parameter dimensions. As described in the E2E-ICD, matrix sizes are represented as {@literal [nCol, nRow]}.

Returns
The size of each dimension. For a scalar, an empty list.

◆ getDoubleValue()

double esa.opensf.osfi.Parameter.getDoubleValue ( )
Returns
Parameter value parsed as a floating point number, valid only for scalars.

◆ getElementType()

ParamType esa.opensf.osfi.Parameter.getElementType ( )
Returns
the element data type of the parameter.

◆ getFileFormattedValue()

static String esa.opensf.osfi.Parameter.getFileFormattedValue ( String  fileName)
static

Ensures that the argument does not contain invalid characters for a path. If it is relative, also resolves it according to the configured base directory.

Parameters
fileNameRaw value of a single element of a FILE or FOLDER parameter.
Returns
Path to the file or folder.
Exceptions
java.nio.file.InvalidPathExceptionif the path is not valid.

◆ getFileValue()

String esa.opensf.osfi.Parameter.getFileValue ( )
Returns
Parameter value parsed as a path to a file or folder, valid only for scalars..
See also
getFileFormattedValue(String)

◆ getIntValue()

int esa.opensf.osfi.Parameter.getIntValue ( )
Returns
Parameter value parsed as an integer, valid only for scalars.

◆ getLocalName()

String esa.opensf.osfi.Parameter.getLocalName ( )
Returns
The "local" part of the parameter path, that is, the part after the last "."

◆ getMatrixBoolean()

boolean [][] esa.opensf.osfi.Parameter.getMatrixBoolean ( )
Returns
Parameter parsed value as a matrix (rectangular array-of-arrays) of booleans. Not valid if the parameter is not a matrix; in that case an 0x0 matrix is returned.

◆ getMatrixDouble()

double [][] esa.opensf.osfi.Parameter.getMatrixDouble ( )
Returns
Parameter parsed value as a matrix (rectangular array-of-arrays) of doubles. Not valid if the parameter is not a matrix; in that case an 0x0 matrix is returned.

◆ getMatrixFile()

String [][] esa.opensf.osfi.Parameter.getMatrixFile ( )
Returns
Parameter parsed value as a matrix (rectangular array-of-arrays) of file paths. Not valid if the parameter is not a matrix; in that case an 0x0 matrix is returned.
See also
getFileFormattedValue(String)

◆ getMatrixInt()

int [][] esa.opensf.osfi.Parameter.getMatrixInt ( )
Returns
Parameter parsed value as a matrix (rectangular array-of-arrays) of integers. Not valid if the parameter is not a matrix; in that case an 0x0 matrix is returned.

◆ getMatrixString()

String [][] esa.opensf.osfi.Parameter.getMatrixString ( )
Returns
Parameter parsed value as a matrix (rectangular array-of-arrays) of strings. Not valid if the parameter is not a matrix; in that case an 0x0 matrix is returned.

◆ getMatrixTime()

TimeValue [][] esa.opensf.osfi.Parameter.getMatrixTime ( )
Returns
Parameter parsed value as a matrix (rectangular array-of-arrays) of timecodes. Not valid if the parameter is not a matrix; in that case an 0x0 matrix is returned.

◆ getMax()

String esa.opensf.osfi.Parameter.getMax ( )
Returns
Maximum value (unparsed).

◆ getMin()

String esa.opensf.osfi.Parameter.getMin ( )
Returns
Minimum value (unparsed).

◆ getName()

String esa.opensf.osfi.Parameter.getName ( )
Returns
The parameter full path.
Deprecated:
Ambiguous function, instead use getLocalName() or getPath().

References esa.opensf.osfi.Parameter.getPath().

◆ getNdims()

int esa.opensf.osfi.Parameter.getNdims ( )
Returns
Number of declared dimensions e.g. 0 for a scalar or 2 for a matrix.

◆ getOtherAttribute()

String esa.opensf.osfi.Parameter.getOtherAttribute ( final String  key)
Returns
the value of the given non-standard attribute, or null if not present.
Parameters
keyattribute name

◆ getOtherAttributes()

Map<String, String> esa.opensf.osfi.Parameter.getOtherAttributes ( )
Returns
a copy of the map of non-standard attributes and their values.

◆ getPath()

String esa.opensf.osfi.Parameter.getPath ( )
Returns
The full path of the parameter, including parent groups.

◆ getRawValue()

String esa.opensf.osfi.Parameter.getRawValue ( )
Returns
Parameter value, unparsed. If an ARRAY-type parameter, returns a structural description of the parameter with the unparsed values.

References esa.opensf.osfi.Parameter.isArray().

◆ getRootNode()

ArrayNode.Raw esa.opensf.osfi.Parameter.getRootNode ( )

Specific method for Array types. Returns a tree-like structure where each node consists of either some data elements or a list of subnodes. They can be parsed individually or in bulk (by depth-first flattening of the tree) into typed values.

Returns
the root node of the values tree.
See also
ArrayNode.Raw

References esa.opensf.osfi.Parameter.isArray().

◆ getStringValue()

String esa.opensf.osfi.Parameter.getStringValue ( )
Returns
Parameter value parsed as a string, valid only for scalars.

◆ getTimeValue()

TimeValue esa.opensf.osfi.Parameter.getTimeValue ( )
Returns
Parameter value parsed as a timecode, valid only for scalars.

◆ getType()

String esa.opensf.osfi.Parameter.getType ( )

Gets the element data type of the parameter, as a string.

Returns
String with the type of the parameter.
See also
getElementType()

◆ getUnits()

String esa.opensf.osfi.Parameter.getUnits ( )
Returns
units of measurement of the parameter, as provided in the XML.

◆ getValue()

String esa.opensf.osfi.Parameter.getValue ( )
Returns
The unparsed parameter value, as read from the XML.
Deprecated:
Ambiguously-named function to be removed, use getRawValue() instead.

References esa.opensf.osfi.Parameter.getRawValue().

◆ getVectorBoolean()

boolean [] esa.opensf.osfi.Parameter.getVectorBoolean ( )
Returns
Parameter value parsed as a Java array of booleans.

◆ getVectorDouble()

double [] esa.opensf.osfi.Parameter.getVectorDouble ( )
Returns
Parameter value parsed as a Java array of doubles.

◆ getVectorFile()

String [] esa.opensf.osfi.Parameter.getVectorFile ( )
Returns
Parameter value parsed as a Java array of files.
See also
getFileFormattedValue(String)

◆ getVectorInt()

int [] esa.opensf.osfi.Parameter.getVectorInt ( )
Returns
Parameter value parsed as a Java array of integers.

◆ getVectorString()

String [] esa.opensf.osfi.Parameter.getVectorString ( )
Returns
Parameter value parsed as a Java array of strings.

◆ getVectorTime()

TimeValue [] esa.opensf.osfi.Parameter.getVectorTime ( )
Returns
Parameter value parsed as a Java array of timecodes.

◆ isArray()

boolean esa.opensf.osfi.Parameter.isArray ( )
Returns
true if this parameter is of structured type ARRAY.
See also
getRootNode()

References esa.opensf.osfi.Parameter.ParamComplexType.ARRAY.

◆ setValue()

void esa.opensf.osfi.Parameter.setValue ( final String  value)

Sets the parameter unparsed (raw) value. Not valid for ARRAY parameters.

Parameters
valueParameter value.

◆ write()

void esa.opensf.osfi.Parameter.write ( )

Prints a textual description of the parameter to the OSFI log as an Info message.

References esa.opensf.osfi.Parameter.getRawValue(), and esa.opensf.osfi.Logger.info().


The documentation for this class was generated from the following file: