K
- Hashable keyV
- Cached valueprivate static class LRUCache.NodeImpl<K,V> extends ExpiryCache.Node<K,V>
Modifier and Type | Field and Description |
---|---|
private long |
accessID
Unique counter assigned each time this element is accessed (created or retrieved)
|
private static long |
nextAccess
Next available node identifier
|
Modifier and Type | Method and Description |
---|---|
protected void |
access()
Assign the next available (higher) access ID to this node.
|
int |
compareTo(ExpiryCache.Node<K,V> n)
Compare this node to another.
|
boolean |
equals(java.lang.Object o)
An implementation of equivalence checking consistent with
compareTo(Node) . |
accessValue, getKey, getValue
private static long nextAccess
private long accessID
public int compareTo(ExpiryCache.Node<K,V> n)
This algorithm generally leaves the least desirable element first in the sorted result.
public boolean equals(java.lang.Object o)
compareTo(Node)
.equals
in class ExpiryCache.Node<K,V>
o
- Object with which to compare this instance.true
if o
is equivalent to this instance, else
false
.protected void access()
access
in class ExpiryCache.Node<K,V>