|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.renderer.aviatrix3d.texture.AVTextureCacheFactory
public class AVTextureCacheFactory
A representation of global cache for texture instance management.
The cache works at the Aviatrix3D Texture or TextureComponent instance level rather than down at the individual images. This allows the VM to discard the lower level image instances if needed, allowing Java3D to do its own management. In addition, it benefits runtime performance of the Java3D scene graph by allowing textures instances to be shared, rather than duplicated.
Different types of cache implementations are allowed (ie different ways of deciding when an texture no longer needs to be in the cache).
The factory also supports the concept of the "default cache". This is used when you want a simple system that doesn't really care about the cache type used and just wants to use this class as a global singleton for storing the texture information. The default cache type can be controlled through either directly setting the value in this class, or using a system property. By defining a value for the property
org.j3d.texture.DefaultCacheTypewith one of the values (case-sensitive)
fixed
, lru
or weakref
. Setting the type through the method call will
override this setting. However, the cache type can only be set once. All
further attempts will result in an exception.
Field Summary |
---|
Fields inherited from interface org.j3d.texture.TextureCacheFactory |
---|
DEFAULT_CACHE_PROP, FIXED_CACHE, LAST_CACHE_ID, LRU_CACHE, WEAKREF_CACHE |
Method Summary | |
---|---|
static AVTextureCache |
getCache()
Fetch the default cache provided by the factory. |
static AVTextureCache |
getCache(int cacheType)
Fetch the cache instance for the given type, creating a new instance if necessary. |
static void |
registerCacheType(int cacheType,
AVTextureCache cache)
Register your custom instance of a texture cache. |
static void |
setDefaultCacheType(int type)
Set the default cache type to be used. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void setDefaultCacheType(int type) throws org.j3d.texture.CacheAlreadySetException
type
- The default type ID
org.j3d.texture.CacheAlreadySetException
- The default type has already been setpublic static AVTextureCache getCache()
setDefaultCacheType(int)
method.
public static AVTextureCache getCache(int cacheType)
cacheType
- An identifier of the required caching algorithm
java.lang.IllegalArgumentException
- The cacheType is not a valid typepublic static void registerCacheType(int cacheType, AVTextureCache cache)
cacheType
- The ID to associate with this cachecache
- The instance of the cache to register
java.lang.IllegalArgumentException
- The cacheType is invalid
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |