542 lines · 15.5 KB · Java
RawDownload
            value = null;            expirationTime = -1;        }    }     private static class SoftCacheEntry            extends SoftReference implements CacheEntry {         private Object key;        private long expirationTime;         SoftCacheEntry(Object key, Object value, long expirationTime,                ReferenceQueue queue) {            super(value, queue);            this.key = key;            this.expirationTime = expirationTime;        }         public Object getKey() {            return key;        }         public Object getValue() {            return get();        }         public boolean isValid(long currentTime) {            boolean valid = (currentTime <= expirationTime) && (get() != null);            if (valid == false) {                invalidate();            }            return valid;        }         public void invalidate() {            clear();            key = null;            expirationTime = -1;        }    } }

Lines 501–542 of 542. Previous lines