01: package org.shiftone.cache.policy.lru;
02:
03: import org.shiftone.cache.util.CacheNode;
04: import org.shiftone.cache.util.LinkedListNode;
05:
06: /**
07: * Class LruNode
08: *
09: *
10: * @author <a href="mailto:jeff@shiftone.org">Jeff Drost</a>
11: * @version $Revision: 1.1 $
12: */
13: class LruNode implements CacheNode {
14:
15: /// private static final Logger LOG = Logger.getLogger(LruNode.class);
16: Object key = null;
17: Object value = null;
18: LinkedListNode fifoNode = null;
19: LinkedListNode lruNode = null;
20: long timeoutTime = 0;
21:
22: public final boolean isExpired() {
23:
24: long timeToGo = timeoutTime - System.currentTimeMillis();
25:
26: return (timeToGo <= 0);
27: }
28:
29: public final Object getValue() {
30: return this .value;
31: }
32:
33: public final void setValue(Object value) {
34: this .value = value;
35: }
36:
37: public String toString() {
38: return "LruNode:" + String.valueOf(key);
39: }
40: }
|