KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > cluster > util > LinkObject


1 /*
2  * Copyright 1999,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.catalina.cluster.util;
18
19 /**
20  * The class <b>LinkObject</b> implements an element
21  * for a linked list, consisting of a general
22  * data object and a pointer to the next element.
23  *
24  * @author Rainer Jung
25  * @author Peter Rossbach
26  * @version $Revision: 1.1 $ $Date: 2005/03/14 21:24:30 $
27
28  */

29
30 public class LinkObject {
31
32     private Object JavaDoc payload;
33     private LinkObject next;
34     private String JavaDoc key ;
35     
36     /**
37      * Construct a new element from the data object.
38      * Sets the pointer to null.
39      * @param Object payload The data object.
40      */

41     public LinkObject(String JavaDoc key,Object JavaDoc payload) {
42         this.payload = payload;
43         this.next = null;
44         this.key = key ;
45     }
46
47     /**
48      * Set the next element.
49      * @param LinkObject next The next element.
50      */

51     public void append(LinkObject next) {
52         this.next = next;
53     }
54
55     /**
56      * Get the next element.
57      * @return The next element.
58      */

59     public LinkObject next() {
60         return next;
61     }
62
63     /**
64      * Get the data object from the element.
65      * @return The data object from the element.
66      */

67     public Object JavaDoc data() {
68         return payload;
69     }
70
71     /**
72      * Get the unique message id
73      * @return the unique message id
74      */

75     public Object JavaDoc getKey() {
76         return key;
77     }
78
79 }
80
Popular Tags