public class ThumbnailCache extends Object
Modifier and Type | Field and Description |
---|---|
protected File |
file
File containing thumbnail cache data.
|
protected Vector |
ids
Thumbnail id strings.
|
protected int |
last
Last retrieved thumbnail index.
|
protected Vector |
offsets
Thumbnail byte offsets.
|
Constructor and Description |
---|
ThumbnailCache(String filename)
Constructs a thumbnail cache that uses the given disk file.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Wipes the thumbnail disk cache.
|
File |
getCacheFile()
Gets the disk cache file.
|
protected long |
getOffset(String id)
Gets the offset corresponding to the given id string.
|
int |
getThumbCount()
Gets the number of thumbnails in the disk cache.
|
long |
getUsage()
Gets thumbnail cache disk usage in bytes.
|
boolean |
isDefault()
Gets whether the default cache file was used because the one supplied to
the constructor was unavailable.
|
protected FlatField |
load(long offset)
Loads the data object at the given byte offset of the cache file.
|
FlatField |
retrieve(String id)
Retrieves the thumbnail with the given id string from the disk cache.
|
protected void |
save(String id,
FlatField thumb)
Saves the given data object to the end of the cache file.
|
void |
store(String id,
FlatField thumb)
Stores the given thumbnail in the disk cache.
|
protected File file
protected Vector ids
protected Vector offsets
protected int last
public ThumbnailCache(String filename)
public FlatField retrieve(String id)
public void clear()
public long getUsage()
public int getThumbCount()
public File getCacheFile()
public boolean isDefault()
protected long getOffset(String id)
protected void save(String id, FlatField thumb) throws IOException
IOException
protected FlatField load(long offset) throws IOException
IOException
Copyright © 2015–2022 SciJava. All rights reserved.