|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object visad.data.FlatFieldCache
public class FlatFieldCache
Memory cache for FlatField
s. Maintains a fixed number of cache
arrays in memory. When a cache member is requested which is not currently
available in the cache it is loaded directly into one of the cache arrays.
This prevents the allocation or garbage collection of data arrays when they
are created. This allows caching to happen close to the data, rather than the
rendering and is intended to allow for large animation loops with as little
an affect as possible on rendering. This can however lead to large latency at
startup due to reading data sources and copying them to the cache arrays.
Most of this class was modeled after the FileFlatField
. This cache,
however, is not a static cache, it is a instance cache. The affect of this is
that if you create several large caches you can very quickly run out of memory.
Constructor Summary | |
---|---|
FlatFieldCache(int cacheSize)
Create a cache with a fixed size and the default strategy. |
|
FlatFieldCache(int cacheSize,
visad.data.FlatFieldCacheStrategy strategy)
Initialize cache. |
Method Summary | |
---|---|
void |
flushCache(visad.data.FlatFieldCache.Entry entry,
FlatFieldCacheAccessor fileAccessor)
Not currently implemented. |
protected float[][] |
getData(AreaImageCacheAdapter owner,
FlatFieldCacheAccessor fileAccessor)
Does the work of getting data from the cache. |
int |
getSize()
|
void |
setDirty(AreaImageCacheAdapter owner,
boolean dirty)
Don't do this. |
String |
toString()
|
protected void |
updateEntry(visad.data.FlatFieldCache.Entry entry,
float[][] data,
visad.data.FlatFieldCache.CacheOwner owner)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FlatFieldCache(int cacheSize)
cacheSize
- public FlatFieldCache(int cacheSize, visad.data.FlatFieldCacheStrategy strategy)
cacheSize
- Number of FlatFields
to maintain in cache, >= 1.strategy
- How cache allocation is performed.Method Detail |
---|
protected void updateEntry(visad.data.FlatFieldCache.Entry entry, float[][] data, visad.data.FlatFieldCache.CacheOwner owner)
protected float[][] getData(AreaImageCacheAdapter owner, FlatFieldCacheAccessor fileAccessor)
owner
- fileAccessor
-
public void flushCache(visad.data.FlatFieldCache.Entry entry, FlatFieldCacheAccessor fileAccessor) throws VisADException
entry
- fileAccessor
-
UnsupportedOperationException
- All the time.
VisADException
public void setDirty(AreaImageCacheAdapter owner, boolean dirty)
owner
- The owner of the cache entry to mark as dirty.dirty
- public String toString()
toString
in class Object
public int getSize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |