|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjmathlib.core.interpreter.RootObject
jmathlib.core.functions.Function
public abstract class Function
This is the base class for all functions
| Field Summary | |
|---|---|
protected long |
lastModified
data and time of last modification of this file on disc |
protected java.lang.String |
name
The functions name |
protected java.lang.String |
pathAndFileName
path and filename where this function is located on the disc |
| Fields inherited from interface jmathlib.core.constants.ErrorCodes |
|---|
ERR_BRACKET_OPEN, ERR_BRACKET_ORDER, ERR_FUNCTION_NOT_FOUND, ERR_FUNCTION_NOT_IMPLEMENTED, ERR_INSUFFICIENT_PARAMETERS, ERR_INVALID_PARAMETER, ERR_LVALUE_REQUIRED, ERR_MATRIX_SINGULAR, ERR_NOT_SQUARE_MATRIX, ERR_OPNOTSUPPORTED, ERR_TOO_MANY_PARAMETERS, ERR_USER_ERROR, ERR_VARIABLE_NOTDEFINED, OK, OK_FUNCTION_PROCESS |
| Fields inherited from interface jmathlib.core.constants.TokenConstants |
|---|
ADDSUB_PRIORITY, AND_PRIORITY, ANDAND_PRIORITY, ASSIGN_PRIORITY, BRACKET_PRIORITY, COMPARE_PRIORITY, CONCAT, MATRIX, MULDIV_PRIORITY, OR_PRIORITY, OROR_PRIORITY, PARAMETER, POWER_PRIORITY, RELATION_PRIORITY, SINGLE, ttDelimiter, ttNotSet, ttOperand, ttOperator |
| Constructor Summary | |
|---|---|
Function()
Default constructor - Creates a function with a null name |
|
Function(java.lang.String _name)
Creates a function called _name |
|
| Method Summary | |
|---|---|
void |
debugLine(java.lang.String s)
write debug line to std-out and file |
boolean |
equals(java.lang.Object obj)
Tests if an object is equal to this function if obj is an instance of Function or Function token then it compares the name of obj to the functions name otherwise it calls the superclasses version |
abstract OperandToken |
evaluate(Token[] operands,
GlobalValues globals)
Executes the function |
long |
getLastModified()
Returns the date of last modification of this function |
java.lang.String |
getName()
|
protected int |
getNArgIn(Token[] operands)
Returns the number of right-hand arguments of the function (e.g.: a=some_function(a,b,c,d) will return "4" |
protected int |
getNArgOut()
Returns the number of left-hand arguments of the function (e.g.) |
int |
getNoOfLeftHandArguments()
Returns the number of left-hand arguments of the function (e.g.) |
java.lang.String |
getPathAndFileName()
returns the path and filename that belongs to this functions |
void |
setLastModified(long _lastModified)
Set the date of last modification of this function |
void |
setName(java.lang.String _name)
Sets the name of this function |
void |
setNoOfLeftHandArguments(int _number)
Sets the number of left-hand arguments of the function (e.g.) |
void |
setPathAndFileName(java.lang.String _pathAndFileName)
sets the path and filename that belongs to this functions |
void |
throwMathLibException(java.lang.String errorMessage)
Throws arithmetic exception for external functions |
| Methods inherited from class jmathlib.core.interpreter.RootObject |
|---|
clone, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String name
protected java.lang.String pathAndFileName
protected long lastModified
| Constructor Detail |
|---|
public Function()
public Function(java.lang.String _name)
_name - = the name of the function| Method Detail |
|---|
public java.lang.String getName()
public void setPathAndFileName(java.lang.String _pathAndFileName)
_pathAndFileName - public java.lang.String getPathAndFileName()
public void setLastModified(long _lastModified)
_lastModified - public long getLastModified()
public void setName(java.lang.String _name)
name - = name of this functionpublic int getNoOfLeftHandArguments()
protected int getNArgOut()
protected int getNArgIn(Token[] operands)
public void setNoOfLeftHandArguments(int _number)
_number - = the number of left hand argumentspublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - = object to test
public abstract OperandToken evaluate(Token[] operands,
GlobalValues globals)
operands - - an array of the functions paramatersglobals - TODO
public void throwMathLibException(java.lang.String errorMessage)
error - text to displaypublic void debugLine(java.lang.String s)
s -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||