01: ///////////////////////////////////////////////////////////////////////////////
02: // Copyright (c) 2001, Jason Baldridge All Rights Reserved.
03: //
04: // This library is free software; you can redistribute it and/or
05: // modify it under the terms of the GNU Lesser General Public
06: // License as published by the Free Software Foundation; either
07: // version 2.1 of the License, or (at your option) any later version.
08: //
09: // This library is distributed in the hope that it will be useful,
10: // but WITHOUT ANY WARRANTY; without even the implied warranty of
11: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: // GNU General Public License for more details.
13: //
14: // You should have received a copy of the GNU Lesser General Public
15: // License along with this program; if not, write to the Free Software
16: // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17: ///////////////////////////////////////////////////////////////////////////////
18:
19: package gnu.trove;
20:
21: /**
22: * Adapter for TLinkable interface which implements the interface and can
23: * therefore be extended trivially to create TLinkable objects without
24: * having to implement the obvious.
25: *
26: * <p>
27: * Created: Thurs Nov 15 16:25:00 2001
28: * </p>
29: *
30: * @author Jason Baldridge
31: * @version $Id: TLinkableAdapter.java,v 1.1 2006/11/10 23:27:56 robeden Exp $
32: * @see gnu.trove.TLinkedList
33: */
34:
35: public class TLinkableAdapter implements TLinkable {
36: TLinkable _previous, _next;
37:
38: /**
39: * Returns the linked list node after this one.
40: *
41: * @return a <code>TLinkable</code> value
42: */
43: public TLinkable getNext() {
44: return _next;
45: }
46:
47: /**
48: * Returns the linked list node before this one.
49: *
50: * @return a <code>TLinkable</code> value
51: */
52: public TLinkable getPrevious() {
53: return _previous;
54: }
55:
56: /**
57: * Sets the linked list node after this one.
58: *
59: * @param linkable a <code>TLinkable</code> value
60: */
61: public void setNext(TLinkable linkable) {
62: _next = linkable;
63: }
64:
65: /**
66: * Sets the linked list node before this one.
67: *
68: * @param linkable a <code>TLinkable</code> value
69: */
70: public void setPrevious(TLinkable linkable) {
71: _previous = linkable;
72: }
73: }
|