KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > shiftone > cache > util > LinkedListNode


1 package org.shiftone.cache.util;
2
3
4
5 /**
6  * Class LinkedListNode
7  *
8  *
9  * @author <a HREF="mailto:jeff@shiftone.org">Jeff Drost</a>
10  * @version $Revision: 1.6 $
11  */

12 public class LinkedListNode
13 {
14
15     LinkedListNode next;
16     LinkedListNode prev;
17     Object JavaDoc value;
18
19     public LinkedListNode(Object JavaDoc value)
20     {
21         this.value = value;
22     }
23
24
25     /**
26      * Method getValue
27      */

28     public Object JavaDoc getValue()
29     {
30         return value;
31     }
32
33
34     /**
35      * Method getNext
36      */

37     public LinkedListNode getNext()
38     {
39
40         return (next.isHeaderNode()
41                 ? null
42                 : next);
43     }
44
45
46     /**
47      * Method getPrevious
48      */

49     public LinkedListNode getPrevious()
50     {
51
52         return (prev.isHeaderNode()
53                 ? null
54                 : prev);
55     }
56
57
58     /**
59      * is this node the header node in a linked list?
60      */

61     boolean isHeaderNode()
62     {
63         return (value == this);
64     }
65 }
66
Popular Tags