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.
-
EmptyList()
- EmptyList() constructs an empty list
-
first()
- first() returns the first element of a non-empty List.
-
getNonEmpty()
- getNonEmpty() gets a NonEmptyList from a List
-
isEmpty()
- isEmpty() tells whether the List is empty.
-
nonEmpty()
- nonEmpty() tells whether the List is non-empty
-
rest()
- rest() returns the rest of a non-empty List.
-
toString()
- toString converts the list to a string using S expression formatting
EmptyList
public EmptyList()
- EmptyList() constructs an empty list
isEmpty
public boolean isEmpty()
- isEmpty() tells whether the List is empty.
- Overrides:
- isEmpty in class List
nonEmpty
public boolean nonEmpty()
- nonEmpty() tells whether the List is non-empty
- Overrides:
- nonEmpty in class List
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
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
getNonEmpty
public NonEmptyList getNonEmpty() throws EmptyListException
- getNonEmpty() gets a NonEmptyList from a List
- Overrides:
- getNonEmpty in class List
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