public class IlvDefaultFileTileCache extends Object
IlvDefaultFileTileCache
manages a set of
tiles saved on disk. The cache size is limited to a maximum disk space.
When the maximum size is reached, the size is decreased by removing
older files. Older files are removed until the minimum size is reached.Constructor and Description |
---|
IlvDefaultFileTileCache()
Constructs a
IlvDefaultFileTileCache with a
maximum size of 5 mega bytes and a releasable size of 1 mega bytes. |
IlvDefaultFileTileCache(long maxSize,
long freeSize)
Constructs a
IlvDefaultFileTileCache specifying
the size parameters of the cache. |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the cache by removing all the registered files.
|
long |
getCurrentSize()
Returns the current size of this file cache
|
void |
objectAccessed(Object o)
Tells the cache that this file has been accessed.
|
void |
objectAdded(Object o)
Add a file to this cache.
|
void |
stats()
Logs some infos about the cache.
|
public IlvDefaultFileTileCache()
IlvDefaultFileTileCache
with a
maximum size of 5 mega bytes and a releasable size of 1 mega bytes.public IlvDefaultFileTileCache(long maxSize, long freeSize)
IlvDefaultFileTileCache
specifying
the size parameters of the cache.maxSize
- The maximum size in bytes.freeSize
- The size in bytes that will be released when the cache is full.public void objectAdded(Object o)
o
- The file to add to this cache.public void objectAccessed(Object o)
setLastModified
is set to System.currentTimeMillis()
.o
- The accessed object.public void stats()
public void clear()
public long getCurrentSize()
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.