public class Length extends DefaultArithFunction
Function: .length(L)
: returns the size of either the list or string L.
Examples:
.length("aa")
: returns 2..length([a,b,c])
: returns 3.internal action version
,
Serialized FormConstructor and Description |
---|
Length() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkArity(int a)
returns true if a is a good number of arguments for the function
|
double |
evaluate(TransitionSystem ts,
Term[] args)
evaluates/computes the function based on the args
|
java.lang.String |
getName()
returns the name of the function
|
allowUngroundTerms, toString
public java.lang.String getName()
ArithFunction
getName
in interface ArithFunction
getName
in class DefaultArithFunction
public double evaluate(TransitionSystem ts, Term[] args) throws JasonException
ArithFunction
evaluate
in interface ArithFunction
evaluate
in class DefaultArithFunction
JasonException
public boolean checkArity(int a)
ArithFunction
checkArity
in interface ArithFunction
checkArity
in class DefaultArithFunction