K
- type of the keypublic class LfuNode<K> extends AbstractNode<K,LfuNode<K>>
TreeMap
. Uses frequency and recency to compare nodes.Constructor and Description |
---|
LfuNode(K key)
Constructor for the LfuNode object.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(LfuNode<K> node)
Compares this node with the specified node.
|
long |
getFrequency()
Returns the value of frequency counter of this node.
|
long |
getId()
Returns the time of the last access to this node.
|
long |
setFrequency(long newFrequency)
Set the access frequency counter of this node.
|
long |
update()
Increments the frequency of this node and sets is access time to the current time.
|
equals, getKey, hashCode, toString
public LfuNode(K key)
key
- key associated with the nodepublic long getFrequency()
public long setFrequency(long newFrequency)
newFrequency
- new frequency of this nodepublic long getId()
public long update()
public int compareTo(LfuNode<K> node)
Copyright © 2016 Egothor. All Rights Reserved.