Package org.opensourcephysics.tools
Interface KnownFunction
- All Superinterfaces:
Function
- All Known Implementing Classes:
KnownPolynomial
,UserFunction
Title: KnownFunction Description: A function that provides its name,
expression and parameters to users.
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Gets a clone of the function.boolean
Determines if another Object is the same as this one.Gets the description of the function.getExpression
(String indepVarName) Gets the equation.getName()
Gets the name of the function.int
Gets the parameter count.getParameterDescription
(int i) Gets a parameter description.getParameterName
(int i) Gets a parameter name.double
getParameterValue
(int i) Gets a parameter value.newUserFunction
(String var) void
setDescription
(String description) Sets the description of the function.void
Sets the name of the function.void
setParameters
(String[] names, double[] values, String[] descriptions) Sets the parameters.void
setParameterValue
(int i, double value) Sets a parameter value.
-
Method Details
-
getParameterCount
int getParameterCount()Gets the parameter count.- Returns:
- the number of parameters
-
getParameterName
Gets a parameter name.- Parameters:
i
- the parameter index- Returns:
- the name of the parameter
-
getParameterValue
double getParameterValue(int i) Gets a parameter value.- Parameters:
i
- the parameter index- Returns:
- the value of the parameter
-
getParameterDescription
Gets a parameter description. May be null.- Parameters:
i
- the parameter index- Returns:
- the description of the parameter (may be null)
-
setParameterValue
void setParameterValue(int i, double value) Sets a parameter value.- Parameters:
i
- the parameter indexvalue
- the value
-
setParameters
Sets the parameters.- Parameters:
names
- the parameter namesvalues
- the parameter valuesdescriptions
- the parameter descriptions
-
getExpression
Gets the equation.- Parameters:
indepVarName
- the name of the independent variable- Returns:
- the equation
-
getName
String getName()Gets the name of the function.- Returns:
- the name
-
setName
Sets the name of the function.- Parameters:
name
- the name
-
getDescription
String getDescription()Gets the description of the function.- Returns:
- the description
-
setDescription
Sets the description of the function.- Parameters:
description
- the description
-
clone
KnownFunction clone()Gets a clone of the function.- Returns:
- the clone
-
equals
Determines if another Object is the same as this one. -
newUserFunction
-