|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.egothor.cache.AbstractNode<K,LfuNode<K>>
org.egothor.cache.lfu.LfuNode<K>
K
- type of the keypublic class LfuNode<K>
Represents a node that can be used as a key for TreeMap
. Uses frequency and recency to compare nodes.
Field Summary |
---|
Fields inherited from class org.egothor.cache.AbstractNode |
---|
key |
Constructor Summary | |
---|---|
LfuNode(K key)
Constructor for the LfuNode object. |
Method Summary | |
---|---|
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. |
Methods inherited from class org.egothor.cache.AbstractNode |
---|
equals, getKey, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LfuNode(K key)
key
- key associated with the nodeMethod Detail |
---|
public long getFrequency()
public long setFrequency(long newFrequency)
newFrequency
- new frequency of this node
public long getId()
public long update()
public int compareTo(LfuNode<K> node)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |