01: package org.shiftone.cache.util;
02:
03: /**
04: * Class LinkedListNode
05: *
06: *
07: * @author <a href="mailto:jeff@shiftone.org">Jeff Drost</a>
08: * @version $Revision: 1.6 $
09: */
10: public class LinkedListNode {
11:
12: LinkedListNode next;
13: LinkedListNode prev;
14: Object value;
15:
16: public LinkedListNode(Object value) {
17: this .value = value;
18: }
19:
20: /**
21: * Method getValue
22: */
23: public Object getValue() {
24: return value;
25: }
26:
27: /**
28: * Method getNext
29: */
30: public LinkedListNode getNext() {
31:
32: return (next.isHeaderNode() ? null : next);
33: }
34:
35: /**
36: * Method getPrevious
37: */
38: public LinkedListNode getPrevious() {
39:
40: return (prev.isHeaderNode() ? null : prev);
41: }
42:
43: /**
44: * is this node the header node in a linked list?
45: */
46: boolean isHeaderNode() {
47: return (value == this);
48: }
49: }
|