public class SoftCache extends Object
Modifier and Type | Class and Description |
---|---|
private static class |
SoftCache.Value |
Modifier and Type | Field and Description |
---|---|
private Map |
map |
private ReferenceQueue |
queue |
Constructor and Description |
---|
SoftCache() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all associations from this map.
|
Object |
get(Object key)
Returns value associated with given key, or null if none.
|
private void |
processQueue() |
Object |
put(Object key,
Object value)
Associates value with given key, returning value previously associated
with key, or null if none.
|
Object |
remove(Object key)
Removes association for given key, returning value previously associated
with key, or null if none.
|
private final Map map
private final ReferenceQueue queue
public Object put(Object key, Object value)
public Object remove(Object key)
public void clear()
private void processQueue()
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.