@Override public synchronized TileBitmap get(Job key) { TileBitmap bitmap = this.lruCache.get(key); if (bitmap != null) { bitmap.incrementRefCount(); } return bitmap; }
@Override public synchronized void put(Job key, TileBitmap bitmap) { if (key == null) { throw new IllegalArgumentException("key must not be null"); } else if (bitmap == null) { throw new IllegalArgumentException("bitmap must not be null"); } TileBitmap old = this.lruCache.get(key); if (old != null) { old.decrementRefCount(); } if (this.lruCache.put(key, bitmap) != null) { LOGGER.warning("overwriting cached entry: " + key); } bitmap.incrementRefCount(); this.observable.notifyObservers(); }
@Override public synchronized TileBitmap get(Job key) { TileBitmap bitmap = this.lruCache.get(key); if (bitmap != null) { bitmap.incrementRefCount(); } return bitmap; }
@Override public synchronized void put(Job key, TileBitmap bitmap) { if (key == null) { throw new IllegalArgumentException("key must not be null"); } else if (bitmap == null) { throw new IllegalArgumentException("bitmap must not be null"); } TileBitmap old = this.lruCache.get(key); if (old != null) { old.decrementRefCount(); } if (this.lruCache.put(key, bitmap) != null) { LOGGER.warning("overwriting cached entry: " + key); } bitmap.incrementRefCount(); this.observable.notifyObservers(); }