01: // You can redistribute this software and/or modify it under the terms of
02: // the Ozone Library License version 1 published by ozone-db.org.
03: //
04: // The original code and portions created by SMB are
05: // Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
06: //
07: // $Id: DxListNode.java,v 1.1 2001/12/18 10:31:30 per_nyfelt Exp $
08:
09: package org.ozoneDB.DxLib;
10:
11: import java.io.IOException;
12:
13: class DxListNode extends DxObject {
14:
15: final static long serialVersionUID = 1L;
16:
17: Object _data;
18: DxListNode _next;
19: DxListNode _prev;
20:
21: public DxListNode() {
22: }
23:
24: public DxListNode(Object obj) {
25: _data = obj;
26: }
27:
28: public void storeBehind(DxListNode node) {
29: // if ((node._prev!=null)||(node._next!=null))
30: // warning ("DxListNode wird in zwei Listen gleichzeitig gespeichert");
31: if (_next != null) {
32: _next._prev = node;
33: }
34: node._next = _next;
35: node._prev = this ;
36: _next = node;
37: }
38:
39: public void storeInfront(DxListNode node) {
40: // if ((node._prev!=null)||(node._next!=null))
41: // ln ("\nWarnung: DxListNode wird in zwei Listen gleichzeitig gespeichert");
42: if (_prev != null) {
43: _prev._next = node;
44: }
45: node._next = this ;
46: node._prev = _prev;
47: _prev = node;
48: }
49:
50: public void remove() {
51: if (_next != null) {
52: _next._prev = _prev;
53: }
54: if (_prev != null) {
55: _prev._next = _next;
56: }
57: _prev = _next = null;
58: }
59:
60: public DxListNode next() {
61: return _next;
62: }
63:
64: public DxListNode prev() {
65: return _prev;
66: }
67:
68: public Object data() {
69: return _data;
70: }
71: }
|