Class MatrixDictGetOr
java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.NaryFunction
com.singularsys.jep.misc.dictionary.GetOr
com.singularsys.extensions.matrix.dictionary.MatrixDictGetOr
- All Implemented Interfaces:
PostfixMathCommandI,Serializable
Implementation of GetOr compatible with the matrix package.
This version uses
FieldI.eq(Object, Object)
to tests keys for equality so
it can also be used with the com.singularsys.extensions.field
package.
Allows
mat = [['x',2], ['y',3], ['z',4]];
getOr(mat,'x',-1);
- Since:
- 4.1 extensions 2.2
- See Also:
-
Field Summary
FieldsFields inherited from class com.singularsys.jep.functions.PostfixMathCommand
curNumberOfParameters, description, name, NaN, numberOfParameters -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.singularsys.jep.functions.NaryFunction
runMethods inherited from class com.singularsys.jep.functions.PostfixMathCommand
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, asType, checkNumberOfParameters, getDescription, getDescription, getDescriptionWithType, getName, getNumberOfParameters, setCurNumberOfParameters, setDescription, setName, toString, toString
-
Field Details
-
mf
-
-
Constructor Details
-
MatrixDictGetOr
-
-
Method Details
-
eval
Description copied from class:NaryFunctionEvaluate the function- Overrides:
evalin classGetOr- Parameters:
args- arguments to the function- Returns:
- value returned by the function
- Throws:
EvaluationException- if the calculation cannot be performed
-
eval
- Throws:
EvaluationException
-
eval
- Throws:
EvaluationException
-
equals
Description copied from class:GetOrTest if key equals k. Default implementation useskey.equals(k)- Overrides:
equalsin classGetOr- Parameters:
key- key to testk- key to test- Returns:
- true if parameters are equal
- Throws:
EvaluationException
-