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