public class DoubleList { private DNode head; private class DNode { private Packet p; private DNode prev; private DNode next; //This constructor is called to create a node to add to the list private DNode (Packet p, DNode prev, DNode next) { setPacket(p); setPrev(prev); setNext(next); } //This constructor is called to set up the head node private DNode() { this.p = null; this.prev = this; this.next = this; } //setters private void setNext(DNode n){ next = n; } private DNode getNext () { return next; } private void setPrev(DNode p){ prev = p; } private DNode getPrev() { return prev; } private void setPacket (Packet p) { this.p = p; } private Packet getPacket() { return p; } } //Constructor called to initialize the doubly linked list public DoubleList() { System.out.println ("Default constructor not implemented yet"); } //pre - doubly linked list has been created //post - boolean value returned whether there are nodes // on the list other than head. public boolean isEmpty () { System.out.println ("isEmpty not implemented yet"); return false; } //pre - doubly linked list has been created //post - returns null if the list is empty // returns the packet in the first position of the list public Packet removeNode() { System.out.println ("removeNode not implemented yet"); return null; } //pre - doubly linked list has been created //post - finds and removes a node from the list // if a node containing the packetID is found, // returns the pointer to the packet id // If a node containing the packet id is not found, // Returns null. public Packet removeNode(int packetID){ System.out.println ("removeNode(int) not implemented yet"); return null; } //pre - p is a valid packet //post - a node containing p has been added to the list. public void addNode (Packet p) { System.out.println ("addNode not implemented yet"); } //post - if the list is empty, it returns "List empty\n" // if the list is not empty, it adds each packet to string along with // a \n after the packet public String toString() { System.out.println ("Default constructor not implemented yet"); return ""; } //Use this space for test cases public static void main (String[] args) { } }