Class FunctionManager
java.lang.Object
com.github.gbenroscience.util.FunctionManager
- Author:
- JIBOYE OLUWAGBEMIRO OLAOLUWA
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AtomicIntegerThis is an indicator of the total number of anonymous functions ever created since the code was run in this session.static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Functionstatic FunctionAdds a Function object to this FunctionManager.static final voidclear()static voidDeletes all anonymous functionsstatic booleancontainsAlgebraicFunction(String fName) static booleancontainsAny(String fName) static booleancontainsMatrix(String fName) static intstatic voidRemoves a Function object from this FunctionManager.static FunctiongetFunction(String fName) static voidRegisters the parameters of all registered functions as Variables on the Variable Registry.static voidstatic voidstatic FunctionSome actions require a handle being gotten on a function name.static FunctionCreates the anonymous copy of a Functionstatic FunctionlockDownAnon(String... independentVars) Create a dummy function to be populated with its true values later.static FunctionAttempts to retrieve a Function object from a FunctionManager based on its name.static voidstatic voidupdate()Saves stored functions and: updates the client UIs that use this manager.static voidUpdates the Map with the most recent version of this Function.static voidUsed to update Functions by name.
-
Field Details
-
ANON_PREFIX
- See Also:
-
ANON_CURSOR
This is an indicator of the total number of anonymous functions ever created since the code was run in this session. -
FUNCTIONS
-
-
Constructor Details
-
FunctionManager
public FunctionManager()
-
-
Method Details
-
containsAlgebraicFunction
- Parameters:
fName- The name of the dependent variable of the function or the full name of the function which is a combination of the name of its dependent variable and its independent variables enclosed in circular parentheses. e.g in y = x^3, either y or y(x) may be supplied.- Returns:
- true if a Function exists by the name supplied, but it is not a matrix
-
containsMatrix
- Parameters:
fName-- Returns:
- true if the function exists and it is matrix type
-
containsAny
- Parameters:
fName-- Returns:
- true if the function exists and is either Matrix or Algebraic
-
getFunction
-
lookUp
-
lockDown
-
lockDownAnon
-
lockDownAnon
-
add
Adds a Function object to this FunctionManager.- Parameters:
expression- The expression that creates the Function to add. The form is:F=@(x,y,z,...)mathexpr. e.g y=@(x)3x-x^2; Functions take precedence over variables.. so if a function called sin_func is created and there exists a variable with that name, the system discards that variable
-
add
-
load
-
load
-
delete
Removes a Function object from this FunctionManager.- Parameters:
fName-
-
update
-
update
Updates the Map with the most recent version of this Function.- Parameters:
f-
-
clearAnonymousFunctions
public static void clearAnonymousFunctions()Deletes all anonymous functions -
clear
public static final void clear() -
countAnonymousFunctions
public static int countAnonymousFunctions()- Returns:
- the number of anonymous functions in the FunctionManager.
-
getDefinedFunctions
-
update
public static void update()Saves stored functions and: updates the client UIs that use this manager. -
initializeFunctionVars
public static void initializeFunctionVars()Registers the parameters of all registered functions as Variables on the Variable Registry. -
main
-