01: /*
02: * (C) Copyright 2003 Nabh Information Systems, Inc.
03: *
04: * All copyright notices regarding Nabh's products MUST remain
05: * intact in the scripts and in the outputted HTML.
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public License
08: * as published by the Free Software Foundation; either version 2.1
09: * of the License, or (at your option) any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19: *
20: */
21:
22: package com.nabhinc.util;
23:
24: /**
25: * An element in the Queue. Essentially a linked list.
26: * Helper class used by Queue
27: *
28: * @author Padmanabh Dabke
29: * (c) 2003 Nabh Information Systems, Inc. All Rights Reserved.
30: */
31: public class QElement implements java.io.Serializable {
32:
33: /**
34: * Comment for <code>serialVersionUID</code>
35: */
36: private static final long serialVersionUID = 4051324543937164592L;
37:
38: /**
39: * Data associated with this element
40: */
41: public java.io.Serializable data = null;
42:
43: /**
44: * Element index
45: */
46: public int index = -1;
47:
48: /**
49: * Next element in the queue
50: */
51: public QElement next = null;
52:
53: /**
54: * Constructs a QueueElement whose value is the given object
55: * @param o Object that will be potentially added to a Queue
56: */
57: public QElement(int ind, java.io.Serializable o) {
58: index = ind;
59: data = o;
60: next = null;
61: }
62:
63: /**
64: * Adds an object as the next element in the queue.
65: * @param o Object to added to the queue.
66: */
67: public QElement addObject(int index, java.io.Serializable o) {
68: next = new QElement(index, o);
69: return next;
70: }
71: }
|