K
- the type of keys maintained by the mapV
- the type of mapped valuespublic class EvictibleEntry<K,V> extends Object implements Map.Entry<K,V>
Map.Entry
used by
ConcurrentMapWithTimedEvictionDecorator
and other interfaces and
classes in this package. Besides the key and the value, the entry has
additional properties such as its map, eviction time, and custom data, as
well as additional helper methods.Modifier and Type | Method and Description |
---|---|
void |
evict(boolean cancelPendingEviction)
Actually evicts the entry from its map by calling the evict
method on the map, passing the specified flag.
|
Object |
getData()
Returns the additional data associated with this entry.
|
long |
getEvictionTime()
Returns the eviction time of this entry, in nanoseconds.
|
K |
getKey()
Returns the key corresponding to this entry.
|
V |
getValue()
Returns the value corresponding to this entry.
|
boolean |
isEvictible()
Returns true if the entry is evictible.
|
void |
setData(Object data)
Sets the additional data associated with this entry.
|
V |
setValue(V value)
Replaces the value corresponding to this entry with the specified value.
|
boolean |
shouldEvict()
Returns true if the entry should be evicted.
|
String |
toString() |
public K getKey()
public V getValue()
public V setValue(V value)
setValue
in interface Map.Entry<K,V>
value
- new value to be stored in this entryClassCastException
- if the class of the specified value prevents it from being
stored in the backing mapNullPointerException
- if the specified value is null
public boolean isEvictible()
public long getEvictionTime()
public Object getData()
public void setData(Object data)
data
- additional data associated with this entrypublic boolean shouldEvict()
public void evict(boolean cancelPendingEviction)
cancelPendingEviction
- true if any pending evictions of the entry should be
cancelledCopyright © 2012–2016. All rights reserved.