import java.util.Iterator; /** * Doubly linked lists. */ public class DoublyLinkedList implements ListOf { // FIELDS // CONSTRUCTORS /** * Create a new linked list. */ public DoublyLinkedList() { } // DoublyLinkedList // ITERABLE METHODS @Override public Iterator iterator() { return null; // STUB } // iterator() // LISTOF METHODS public void insert(T val, Cursor c) throws Exception { throw new UnsupportedOperationException("STUB"); } // insert(T, Cursor) public void append(T val) throws Exception { throw new UnsupportedOperationException("STUB"); } // append(T) public void prepend(T val) throws Exception { throw new UnsupportedOperationException("STUB"); } // prepend(T) public void delete(Cursor c) throws Exception { throw new UnsupportedOperationException("STUB"); } // delete(Cursor) public Cursor front() throws Exception { throw new UnsupportedOperationException("STUB"); } // front() public void advance(Cursor c) throws Exception { throw new UnsupportedOperationException("STUB"); } // advance(Cursor) public void retreat(Cursor c) throws Exception { throw new UnsupportedOperationException("STUB"); } // retreat(Cursor) public T get(Cursor c) throws Exception { throw new UnsupportedOperationException("STUB"); } // get public T getPrev(Cursor c) throws Exception { throw new UnsupportedOperationException("STUB"); } // getPrev(Cursor) public boolean hasNext(Cursor c) { return false; // STUB } // hasNext public boolean hasPrev(Cursor c) { return false; // STUB } // hasPrev public void swap(Cursor c1, Cursor c2) throws Exception { throw new UnsupportedOperationException("STUB"); } // swap(Cursor, Cursor) public boolean search(Cursor c, Predicate pred) throws Exception { throw new UnsupportedOperationException("STUB"); } // search(Cursor, Predicate) public ListOf select(Predicate pred) throws Exception { throw new UnsupportedOperationException("STUB"); } // select(Predicate) public ListOf subList(Cursor start, Cursor end) throws Exception { throw new UnsupportedOperationException("STUB"); } // subList(Cursor, Cursor) public boolean precedes(Cursor c1, Cursor c2) throws Exception { throw new UnsupportedOperationException("STUB"); } // precedes(Cursor, Cursor) } // class DoublyLinkedList /** * Nodes in the list. */ class Node { T val; Node next; Node prev; /** * Create a new node. */ public Node(T val) { this.val = val; this.next = null; this.prev = null; } // Node(T) } // Node /** * Cursors in the list. */ class DoublyLinkedListCursor implements Cursor { Node pos; /** * Create a new cursor that points to a node. */ public DoublyLinkedListCursor(Node pos) { this.pos = pos; } // DoublyLinkedListCursor } // DoublyLinkedListCursor