public class DataCache extends Object
Modifier and Type | Field and Description |
---|---|
protected static boolean |
DEBUG
Debugging flag.
|
protected Hashtable |
hash
Hashtable backing this cache of full-resolution data.
|
Constructor and Description |
---|
DataCache()
Constructs a cache for managing full-resolution data in memory.
|
Modifier and Type | Method and Description |
---|---|
void |
dump(DataTransform trans,
int[] pos,
String append)
Removes the data object at the specified dimensional position from the
cache.
|
void |
dump(DataTransform trans,
String append)
Removes from the cache data objects at all dimensional positions for the
given data object.
|
protected void |
dump(String key)
Removes the data object at the specified key from the cache.
|
void |
dumpAll()
Removes everything from the cache.
|
protected Data |
getCachedData(String key)
Gets the data in the cache at the specified key.
|
Data |
getData(DataTransform trans,
int[] pos,
String append,
int dim)
Gets the data object from the cache, computing it if the cache misses.
|
protected String |
getKey(DataTransform trans,
int[] pos,
String append)
Gets a key string suitable for hashing for the given transform at the
specified position.
|
boolean |
hasData(DataTransform trans,
int[] pos,
String append)
Gets whether the cache has data for the given transform at the specified
dimensional position.
|
protected void |
putCachedData(String key,
Data d)
Sets the data in the cache at the specified key.
|
void |
putData(DataTransform trans,
int[] pos,
String append,
Data d)
Puts the given data object into the cache for the specified transform at
the given dimensional position.
|
protected static final boolean DEBUG
protected Hashtable hash
public DataCache()
public Data getData(DataTransform trans, int[] pos, String append, int dim)
public void putData(DataTransform trans, int[] pos, String append, Data d)
public boolean hasData(DataTransform trans, int[] pos, String append)
public void dump(DataTransform trans, int[] pos, String append)
public void dump(DataTransform trans, String append)
public void dumpAll()
protected Data getCachedData(String key)
protected void putCachedData(String key, Data d)
protected void dump(String key)
protected String getKey(DataTransform trans, int[] pos, String append)
Copyright © 2015–2022 SciJava. All rights reserved.