public class MinMax extends ArrayFunctionBase
min([1,[2,3]])
will be 1.ArrayFunctionBase.ZeroLengthErrorBehaviour
Modifier and Type | Field and Description |
---|---|
protected Comparative |
comp
Used to compare greater than or less than between objects.
|
curNumberOfParameters, name, NaN, numberOfParameters
Constructor and Description |
---|
MinMax(boolean isMin)
Constructor.
|
MinMax(Comparative comp)
Constructor allowing for a different Comparative object.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
calc(java.util.List<java.lang.Object> v)
Abstract method for performing the array calculation.
|
Comparative |
getComp()
Return the Comparative objected used to order the objects.
|
java.lang.Object |
minmax(java.util.List<java.lang.Object> vals) |
addToArray, checkNumberOfParameters, getZeroLengthErrorBehaviour, run, setZeroLengthErrorBehaviour, throwAtLeastOneExcep
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, getName, getNumberOfParameters, setCurNumberOfParameters, setName, toString, toString
protected Comparative comp
public MinMax(boolean isMin)
isMin
- set to true for Minimum, false for Maximumpublic MinMax(Comparative comp)
Comparative.compare(Object, Object)
method will be used to compare elements.comp
- a Comparative object or subclass implemented less than or greater than.protected java.lang.Object calc(java.util.List<java.lang.Object> v) throws EvaluationException
ArrayFunctionBase
calc
in class ArrayFunctionBase
v
- The list to operate on. Note this is in reverse order of the arguments of the function.EvaluationException
- if the calculation cannot be performedpublic java.lang.Object minmax(java.util.List<java.lang.Object> vals) throws EvaluationException
EvaluationException
public Comparative getComp()
Copyright © 2018 Singular Systems http://www.singularsys.com/jep