csheets.core.formula.lang
Class Factorial

java.lang.Object
  extended by csheets.core.formula.lang.Factorial
All Implemented Interfaces:
Function

public class Factorial
extends Object
implements Function

A function that returns the factorial of its argument.

Author:
Einar Pehrson

Field Summary
static FunctionParameter[] parameters
          The only parameter: a numeric term
 
Constructor Summary
Factorial()
          Creates a new instance of the FACT function.
 
Method Summary
 Value applyTo(Expression[] arguments)
          Invokes the function using the given arguments and returns the result.
 String getIdentifier()
          Returns the operator's string identirifer.
 FunctionParameter[] getParameters()
          Returns the parameters of the function.
 boolean isVarArg()
          Returns whether the function accepts a variable number of arguments, i.e. whether the function's parameter list is unbounded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parameters

public static final FunctionParameter[] parameters
The only parameter: a numeric term

Constructor Detail

Factorial

public Factorial()
Creates a new instance of the FACT function.

Method Detail

getIdentifier

public String getIdentifier()
Description copied from interface: Function
Returns the operator's string identirifer.

Specified by:
getIdentifier in interface Function
Returns:
a string representation of the operator.

applyTo

public Value applyTo(Expression[] arguments)
              throws IllegalValueTypeException
Description copied from interface: Function
Invokes the function using the given arguments and returns the result.

Specified by:
applyTo in interface Function
Returns:
the result of the operation
Throws:
IllegalValueTypeException

getParameters

public FunctionParameter[] getParameters()
Description copied from interface: Function
Returns the parameters of the function.

Specified by:
getParameters in interface Function
Returns:
the parameters of the function

isVarArg

public boolean isVarArg()
Description copied from interface: Function
Returns whether the function accepts a variable number of arguments, i.e. whether the function's parameter list is unbounded.

Specified by:
isVarArg in interface Function
Returns:
true if the function accepts a variable number of arguments