Back to index

wims  3.65+svn20090927
LinkedElement.java
Go to the documentation of this file.
00001 /*
00002 $Id: LinkedElement.java,v 1.2 2003/02/18 11:48:48 sander Exp $
00003 */
00004 
00005 
00006 package fr.ove.utils;
00007 
00008 import java.io.Serializable;
00009 
00019 public class LinkedElement implements Serializable {
00023     private Object element;
00024     
00028     private LinkedElement previous;
00029     
00033     private LinkedElement next;
00034     
00038     public LinkedElement() {
00039         this(null);
00040     }
00041     
00046     public LinkedElement(Object element) {
00047         this.element = element;
00048         previous = null;
00049         next = null;
00050     }
00051     
00055     public void setElement(Object element) {
00056         this.element = element;
00057     }
00058     
00062     public Object getElement() {
00063         return element;
00064     }
00065     
00069     public void setPrevious(LinkedElement previous) {
00070         this.previous = previous;
00071     }
00072     
00076     public LinkedElement getPrevious() {
00077         return previous;
00078     }
00079     
00083     public void setNext(LinkedElement next) {
00084         this.next = next;
00085     }
00086     
00090     public LinkedElement getNext() {
00091         return next;
00092     }
00093     
00097     public void remove() {
00098         element = null;
00099         
00100         if (previous != null)
00101             previous.next = next;
00102             
00103         if (next != null)
00104             next.previous = previous;
00105     }
00106     
00110     public String toString() {
00111         return element.toString();
00112     }
00113 }