public synchronized void update(Observable possibleSunTileCache,
Object possibleCachedTile) {
LCTileCache lc_tile_cache = null;
CachedTile cached_tile = null;
int cache_event = -1;
// check SunTileCache
if ( possibleSunTileCache instanceof LCTileCache ) {
lc_tile_cache = (LCTileCache) possibleSunTileCache;
} else {
return;
}
// check cached tile
if ( (possibleCachedTile != null) &&
(possibleCachedTile instanceof CachedTile) ) {
cached_tile = (CachedTile) possibleCachedTile;
cache_event = cached_tile.getAction();
if ( cache_event == CACHE_EVENT_ABOUT_TO_REMOVE_TILE ) {
return;
}
} else {
return;
}
// collect information
RenderedImage image = (RenderedImage) cached_tile.getOwner();
final long tileSize = cached_tile.getTileSize();
final long timeStamp = cached_tile.getTileTimeStamp();
final long cacheHits = lc_tile_cache.getCacheHitCount();
final long cacheMisses = lc_tile_cache.getCacheMissCount();
final long tileCount = lc_tile_cache.getCacheTileCount();
float memoryCapacity = (float) lc_tile_cache.getMemoryCapacity();