Package edu.uky.ai.io

Class List

java.lang.Object
edu.uky.ai.io.Node
edu.uky.ai.io.List

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

    Fields 
    Modifier and Type Field Description
    Node first
    The first elerment in this list
    int length
    The number of elements in this list

    Fields inherited from class edu.uky.ai.io.Node

    next
  • Method Summary

    Modifier and Type Method Description
    Node requireFirst()
    Returns the first element in the list or throws an exception if no such element exists.
    java.lang.String toString()  

    Methods inherited from class edu.uky.ai.io.Node

    asList, asList, asSymbol, asSymbol, isList, isList, isSymbol, isSymbol, parse, parse, requireNext

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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 java.lang.String toString()
      Overrides:
      toString in class java.lang.Object