public class Ranks extends NaryFunction implements JepComponent
Modifier and Type | Class and Description |
---|---|
static class |
Ranks.Type
Type of Rank to calculate.
|
curNumberOfParameters, name, NaN, numberOfParameters
Constructor and Description |
---|
Ranks(Ranks.Type type,
boolean descending,
FieldI f)
Construct the rank function.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkNumberOfParameters(int n)
Checks the number of parameters of the function.
|
java.lang.Object |
eval(java.lang.Object[] args)
Evaluate the function
|
JepComponent |
getLightWeightInstance()
Gets a light-weight instance suitable for using in multiple threads.
|
void |
init(Jep jep)
Initialize the component.
|
run
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, getName, getNumberOfParameters, setCurNumberOfParameters, setName, toString, toString
public Ranks(Ranks.Type type, boolean descending, FieldI f)
type
- Method used to calculate ranks, Type.COMPETITION is standarddescending
- whether ranks are calculated in descending (standard) or
ascending order. In descending order the highest term has a rank of 1.f
- fieldpublic boolean checkNumberOfParameters(int n)
PostfixMathCommand
checkNumberOfParameters
in interface PostfixMathCommandI
checkNumberOfParameters
in class PostfixMathCommand
n
- number of parameters function will be called with.public java.lang.Object eval(java.lang.Object[] args) throws EvaluationException
NaryFunction
eval
in class NaryFunction
args
- arguments to the functionEvaluationException
- if the calculation cannot be performedpublic void init(Jep jep)
JepComponent
init
in interface JepComponent
jep
- the current Jep instancepublic JepComponent getLightWeightInstance()
JepComponent
getLightWeightInstance
in interface JepComponent
Copyright © 2018 Singular Systems http://www.singularsys.com/jep