|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.jniwrapper.util.FunctionCache
Allows to cache softly-referenced Function instances,
which provides automatic removal of un-referenced instances in low memory conditions.
When initialized with a library name, the cache automatically creates the
library instance.
SoftCache| Constructor Summary | |
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. |
|
| Method Summary | |
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
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.| Method Detail |
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.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||