public class FunctionCache
extends java.lang.Object
Function instances, which
provides automatic removal of unreferenced instances under low memory
conditions. When initialized with a library name, the cache automatically
creates the library instance.SoftCache| Constructor and Description |
|---|
FunctionCache(Library library)
Creates a cache that uses the passed library instance.
|
FunctionCache(java.lang.String libraryName)
Creates a cache for the library with the passed name.
|
| Modifier and Type | Method and Description |
|---|---|
Function |
getFunction(java.lang.String name)
Gets a function specified by the name in the cache, or queries the
function instance from the associated library, and caches it for
subsequent requests.
|
void |
getVariable(java.lang.String name,
Parameter variable) |
public FunctionCache(java.lang.String libraryName)
libraryName - a name of the library.java.lang.IllegalArgumentException - of the passed value is
null or empty string.public FunctionCache(Library library)
library - a library to be used by the cache.java.lang.NullPointerException - if the passed library instance is
null.public Function getFunction(java.lang.String name)
name - the name of the function to get.Function instance.NoSuchFunctionException - if a function is not found in the
associated library.public void getVariable(java.lang.String name,
Parameter variable)