Class DoublyLinkedList.Node<Item>

java.lang.Object
dsa.lab02.exercises.DoublyLinkedList.Node<Item>
Type Parameters:
Item - the item type
All Implemented Interfaces:
LinkedNode<Item>
Enclosing class:
DoublyLinkedList<Item>

public static class DoublyLinkedList.Node<Item> extends Object implements LinkedNode<Item>
A node in a doubly-linked list.

Holds direct links to both the previous and next nodes.

  • Constructor Details

    • Node

      public Node(DoublyLinkedList<Item> list, Item item)
      Construct a node with the given item.
      Parameters:
      list - the containing linked list
      item - the contained item
    • Node

      public Node(DoublyLinkedList<Item> list, DoublyLinkedList.Node<Item> previous, Item item)
      Construct a node with the given predecessor and item.
      Parameters:
      list - the containing linked list
      previous - the previous node
      item - the contained item
    • Node

      public Node(DoublyLinkedList<Item> list, Item item, DoublyLinkedList.Node<Item> next)
      Construct a node with the given item and successor.
      Parameters:
      list - the containing linked list
      item - the contained item
      next - the next node
    • Node

      public Node(DoublyLinkedList<Item> list, DoublyLinkedList.Node<Item> previous, Item item, DoublyLinkedList.Node<Item> next)
      Construct a node with the given predecessor, item and successor.
      Parameters:
      list - the containing linked list
      previous - the previous node
      item - the contained item
      next - the next node
  • Method Details