Class MatrixDictPut
java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.NaryFunction
com.singularsys.jep.misc.dictionary.Put
com.singularsys.extensions.matrix.dictionary.MatrixDictPut
- All Implemented Interfaces:
ZeroLengthBehaviourI,ZeroLengthBehaviourI.DefaultZeroLengthBehaviourI,PostfixMathCommandI,Serializable
Implementation of Put compatible with the matrix package.
This version uses
If the key is not in the map it will throw an EvaluationsException.
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]];
put(mat,'x',5);
- Since:
- 4.1 extensions 2.2
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.singularsys.jep.functions.ZeroLengthBehaviourI
ZeroLengthBehaviourI.DefaultZeroLengthBehaviourI, ZeroLengthBehaviourI.ZeroLengthErrorBehaviour, ZeroLengthBehaviourI.ZeroLengthHelper -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FieldIprotected ZeroLengthBehaviourI.ZeroLengthHelperFields inherited from class com.singularsys.jep.functions.PostfixMathCommand
curNumberOfParameters, description, name, NaN, numberOfParameters -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanTest if key equals k.protected Objectprotected ObjectEvaluate the functiongetErrorMessage(String name) Gets the zero length error message.Gets the helper class which implements the zero length behaviour.Methods inherited from class com.singularsys.jep.misc.dictionary.Put
checkNumberOfParameters, eval, evalMethods 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, getDescription, getDescription, getDescriptionWithType, getName, getNumberOfParameters, setCurNumberOfParameters, setDescription, setName, toString, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.singularsys.jep.functions.ZeroLengthBehaviourI
getValueOrException, zeroLengthResultOrExceptionMethods inherited from interface com.singularsys.jep.functions.ZeroLengthBehaviourI.DefaultZeroLengthBehaviourI
getZeroLengthErrorBehaviour, getZeroLengthValue, setZeroLengthErrorBehaviour, setZeroLengthValue
-
Field Details
-
mf
-
zeroLengthHelper
-
-
Constructor Details
-
MatrixDictPut
-
-
Method Details
-
eval
Description copied from class:NaryFunctionEvaluate the function- Overrides:
evalin classPut- 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:PutTest if key equals k. Default implementation useskey.equals(k)- Overrides:
equalsin classPut- Parameters:
key- key to testk- key to test- Returns:
- true if parameters are equal
- Throws:
EvaluationException
-
getZeroLengthHelper
Description copied from interface:ZeroLengthBehaviourI.DefaultZeroLengthBehaviourIGets the helper class which implements the zero length behaviour. The standard implementation is:ZeroLengthHelper zeroLengthHelper = new ZeroLengthHelper(); @Override public ZeroLengthBehaviourI getZeroLengthHelper() { return zeroLengthHelper; }- Specified by:
getZeroLengthHelperin interfaceZeroLengthBehaviourI.DefaultZeroLengthBehaviourI- Returns:
- the helper class
-
getErrorMessage
Description copied from interface:ZeroLengthBehaviourIGets the zero length error message. The default implementation format a string using thefunctions.AtLestOneArgumentIsRequiredproperty.- Specified by:
getErrorMessagein interfaceZeroLengthBehaviourI- Parameters:
name- name of the function passed intoZeroLengthBehaviourI.zeroLengthResultOrException(String)- Returns:
- the error message.
-