Back to index

wims  3.65+svn20090927
Public Member Functions | Protected Member Functions | Static Protected Member Functions
SharpTools.FunctionE Class Reference

This gives us contant E. More...

Inheritance diagram for SharpTools.FunctionE:
Inheritance graph
[legend]
Collaboration diagram for SharpTools.FunctionE:
Collaboration graph
[legend]

List of all members.

Public Member Functions

Number evaluate (SharpTableModel table, Node node, int row, int col) throws ParserException
 This should be implemented in each function.
String getUsage ()
 Return the usage of the function.
String getDescription ()
 Return the description of the function.
boolean requireParams ()
 Whether this function requires parameters.

Protected Member Functions

boolean isRange (Node param)
Node getFirst (Node param)
void checkParamsExist (Node func) throws ParserException

Static Protected Member Functions

static float getSingleParameter (SharpTableModel table, Node node, int row, int col) throws ParserException
 This gets the first float number of a parameter li st, for functions only accepting a single parameter such as ABS, COS , etc.

Detailed Description

This gives us contant E.


E
usage: =E()
returns an approximation of the golden mean
example: =E() returns 2.7182817

Definition at line 943 of file Function.java.


Member Function Documentation

void SharpTools.Function.checkParamsExist ( Node  func) throws ParserException [inline, protected, inherited]

Definition at line 42 of file Function.java.

                                                                      {
       
       if (func.getParams().size()==0){
           throw exception;
       }
    }

Here is the caller graph for this function:

Number SharpTools.FunctionE.evaluate ( SharpTableModel  table,
Node  node,
int  row,
int  col 
) throws ParserException [inline, virtual]

This should be implemented in each function.

Parameters:
tablethe SharpTabelModel
nodethe function node starting with the funciton name with a chain of parameters
colthe int column coordinate
rowthe int row coordinate
Exceptions:
ParserException

Implements SharpTools.Function.

Definition at line 945 of file Function.java.

                                                                {

       // no parameters allowed
       if (node.getParams().size() != 0)
           throw new ParserException("#PARAM?");

       return new Float(Math.E);
    }

Here is the call graph for this function:

String SharpTools.FunctionE.getDescription ( ) [inline, virtual]

Return the description of the function.

Implements SharpTools.Function.

Definition at line 959 of file Function.java.

                                   {
       return SharpTools.translation.getProperty("e_desc");
       //return "Returns value of e.";
    }
Node SharpTools.Function.getFirst ( Node  param) [inline, protected, inherited]

Definition at line 37 of file Function.java.

                                        {
       return (Node)param.getExp().getFirst();
    }    

Here is the call graph for this function:

Here is the caller graph for this function:

static float SharpTools.Function.getSingleParameter ( SharpTableModel  table,
Node  node,
int  row,
int  col 
) throws ParserException [inline, static, protected, inherited]

This gets the first float number of a parameter li st, for functions only accepting a single parameter such as ABS, COS , etc.

Parameters:
tablethe SharpTabelModel
nodethe formula unit
colthe int column coordinate
rowthe int row coordinate
Returns:
the float number

Definition at line 61 of file Function.java.

                              {
       //     Node param = node.getNextParam();
       LinkedList params = node.getParams();

       if (params.size() != 1)
           throw new ParserException("#PARAM?");

       LinkedList exp = ((Node)params.getFirst()).getExp();
       
       return Formula.evaluate(table, exp, row, col).floatValue();

    }

Here is the call graph for this function:

Here is the caller graph for this function:

String SharpTools.FunctionE.getUsage ( ) [inline, virtual]

Return the usage of the function.

Implements SharpTools.Function.

Definition at line 955 of file Function.java.

                             {
       return "E()";
    }
boolean SharpTools.Function.isRange ( Node  param) [inline, protected, inherited]

Definition at line 29 of file Function.java.

                                          {
       LinkedList exp = param.getExp();
       return exp.size() == 1 &&
           ((Node)exp.getFirst()).isType(Node.COLON);
           //((Node)param.getExp().getFirst()).isType(Node.COLON);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Whether this function requires parameters.

By default yes.

See also:
FunctionPI
FunctionE

Reimplemented from SharpTools.Function.

Definition at line 964 of file Function.java.

{ return false; }

The documentation for this class was generated from the following file: