visad.data
Class FlatFieldCache
- java.lang.Object
-
- visad.data.FlatFieldCache
-
public class FlatFieldCache extends java.lang.ObjectMemory cache forFlatFields. 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
Constructors Constructor and Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidflushCache(visad.data.FlatFieldCache.Entry entry, FlatFieldCacheAccessor fileAccessor)Not currently implemented.intgetSize()voidsetDirty(AreaImageCacheAdapter owner, boolean dirty)Don't do this.java.lang.StringtoString()
-
-
-
Constructor Detail
-
FlatFieldCache
public FlatFieldCache(int cacheSize)
Create a cache with a fixed size and the default strategy.- Parameters:
cacheSize-
-
FlatFieldCache
public FlatFieldCache(int cacheSize, visad.data.FlatFieldCacheStrategy strategy)Initialize cache.- Parameters:
cacheSize- Number ofFlatFieldsto maintain in cache, >= 1.strategy- How cache allocation is performed.
-
-
Method Detail
-
flushCache
public void flushCache(visad.data.FlatFieldCache.Entry entry, FlatFieldCacheAccessor fileAccessor) throws VisADExceptionNot currently implemented.- Parameters:
entry-fileAccessor-- Throws:
java.lang.UnsupportedOperationException- All the time.VisADException
-
setDirty
public void setDirty(AreaImageCacheAdapter owner, boolean dirty)
Don't do this.- Parameters:
owner- The owner of the cache entry to mark as dirty.dirty-
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getSize
public int getSize()
-
-
DMelt 3.0 © DataMelt by jWork.ORG