jhplot.math.exp4j.function
Class Function
- java.lang.Object
-
- jhplot.math.exp4j.function.Function
-
public abstract class Function extends java.lang.Object
A class representing a Function which can be used in an expression
-
-
Constructor Summary
Constructors Constructor and Description Function(java.lang.String name)
Create a new Function with a given name that takes a single argumentFunction(java.lang.String name, int numArguments)
Create a new Function with a given name and number of arguments
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description abstract double
apply(double... args)
Method that does the actual calculation of the function value given the argumentsstatic char[]
getAllowedFunctionCharacters()
Deprecated.since 0.4.5 All unicode letters are allowed to be used in function names since 0.4.3. This API Function can be safely ignored. Checks for function name validity can be done using Character.isLetter() et al.java.lang.String
getName()
Get the name of the Functionint
getNumArguments()
Get the number of arguments for this functionstatic boolean
isValidFunctionName(java.lang.String name)
-
-
-
Constructor Detail
-
Function
public Function(java.lang.String name, int numArguments)
Create a new Function with a given name and number of arguments- Parameters:
name
- the name of the FunctionnumArguments
- the number of arguments the function takes
-
Function
public Function(java.lang.String name)
Create a new Function with a given name that takes a single argument- Parameters:
name
- the name of the Function
-
-
Method Detail
-
getName
public java.lang.String getName()
Get the name of the Function- Returns:
- the name
-
getNumArguments
public int getNumArguments()
Get the number of arguments for this function- Returns:
- the number of arguments
-
apply
public abstract double apply(double... args)
Method that does the actual calculation of the function value given the arguments- Parameters:
args
- the set of arguments used for calculating the function- Returns:
- the result of the function evaluation
-
getAllowedFunctionCharacters
public static char[] getAllowedFunctionCharacters()
Deprecated. since 0.4.5 All unicode letters are allowed to be used in function names since 0.4.3. This API Function can be safely ignored. Checks for function name validity can be done using Character.isLetter() et al.Get the set of characters which are allowed for use in Function names.- Returns:
- the set of characters allowed
-
isValidFunctionName
public static boolean isValidFunctionName(java.lang.String name)
-
-
DMelt 3.0 © DataMelt by jWork.ORG