Package edu.uky.ai.io

Class List


public class List extends Node
A list is a collection of 0 to many nodes.
Author:
Stephen G. Ware
  • Field Details

    • length

      public final int length
      The number of elements in this list
    • first

      public final Node first
      The first elerment in this list
  • Method Details

    • requireFirst

      public Node requireFirst()
      Returns the first element in the list or throws an exception if no such element exists.
      Returns:
      the first element
      Throws:
      FormatException - if the list does not have a first element
    • toString

      public String toString()
      Overrides:
      toString in class Object