Class Poly.EmptyList
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Poly.EmptyList

java.lang.Object
   |
   +----Poly.List
           |
           +----Poly.EmptyList

public class EmptyList
extends List
EmptyList is the sub-class of List containing the empty list.

Constructor Index

 o EmptyList()
EmptyList() constructs an empty list

Method Index

 o first()
first() returns the first element of a non-empty List.
 o getNonEmpty()
getNonEmpty() gets a NonEmptyList from a List
 o isEmpty()
isEmpty() tells whether the List is empty.
 o nonEmpty()
nonEmpty() tells whether the List is non-empty
 o rest()
rest() returns the rest of a non-empty List.
 o toString()
toString converts the list to a string using S expression formatting

Constructors

 o EmptyList
  public EmptyList()
EmptyList() constructs an empty list

Methods

 o isEmpty
  public boolean isEmpty()
isEmpty() tells whether the List is empty.
Overrides:
isEmpty in class List
 o nonEmpty
  public boolean nonEmpty()
nonEmpty() tells whether the List is non-empty
Overrides:
nonEmpty in class List
 o first
  public Object first() throws EmptyListException
first() returns the first element of a non-empty List.
Throws: EmptyListException
Can't take first of an empty List.
Overrides:
first in class List
 o rest
  public List rest() throws EmptyListException
rest() returns the rest of a non-empty List.
Throws: EmptyListException
Can't take rest of an empty List.
Overrides:
rest in class List
 o getNonEmpty
  public NonEmptyList getNonEmpty() throws EmptyListException
getNonEmpty() gets a NonEmptyList from a List
Overrides:
getNonEmpty in class List
 o toString
  public String toString()
toString converts the list to a string using S expression formatting
Overrides:
toString in class List

All Packages  Class Hierarchy  This Package  Previous  Next  Index