csheets.core.formula.lang
Class Do

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

public class Do
extends Object
implements Function

A function that emulates a looping statement, where each cell in a given range that satisfy a given condition, or each corresponding cell in another range, are passed to a function.

Author:
Einar Pehrson

Field Summary
static FunctionParameter[] parameters
          Parameters: function, function range, condition and condition range
 
Constructor Summary
Do()
          Creates a new instance of the DO 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
Parameters: function, function range, condition and condition range

Constructor Detail

Do

public Do()
Creates a new instance of the DO 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