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

Class Poly.List

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

public class List
extends Object
    List is the basic unit for constructing an open linked list of Objects.
    A List can be either :
      an EmptyList, or 
      a  NonEmptyList, in which case it consists of:
           a Object as the first thing in the list
           a rest which is a List.
  

This class is abstract, even though javadoc might not indicate that.


Variable Index

 o nats
 o nil
nil is the empty-list constant
 o primes

Constructor Index

 o List()

Method Index

 o analysis(Object)
analysis produces a string analyzing objects, especially Lists
 o append(List, List)
append(L, M) returns a List consisting of the elements of L followed by those of M.
 o array()
array() returns an array of elements in list
 o cons(Object, List)
cons returns a new List given a First and a Rest.
 o cons(Object, Seed)
This variant of cons takes a Seed instead of a List as rest, so the list can be grown incrementally.
 o coprefix(long, List)
coprefix creates the list with all but the length-n prefix of a list
 o elements()
elements() returns a ListEnum object, which implements the interface java.util.Enumeration.
 o equals(List)
equals(M) tells whether this List is equal to some other
 o equals(List, List)
equals(L, M) tells whether Lists L and M are equal
 o fifth()
fifth selects the fifth element of a List.
 o first()
first() returns the first element of a non-empty List.
 o first(List)
first(L) returns the first element of its argument.
 o fourth()
fourth selects the fourth element of a List.
 o getNonEmpty()
getNonEmpty() gets a NonEmptyList from a List
 o isEmpty()
isEmpty() tells whether the List is empty.
 o length()
 o list()
list(A, B, C, ...) returns a list made of specific elements.
 o list(Object)
 o list(Object, Object)
 o list(Object, Object, Object)
 o list(Object, Object, Object, Object)
 o list(Object, Object, Object, Object, Object)
 o list(Object, Object, Object, Object, Object, Object)
 o list(Object, Object, Object, Object, Object, Object, Object)
 o list(Object, Object, Object, Object, Object, Object, Object, Object)
 o list(Object, Object, Object, Object, Object, Object, Object, Object, Object)
 o list(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)
 o list(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)
 o list(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)
 o list(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)
 o list(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)
 o list(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)
 o list(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)
 o ListFromEnum(Enumeration)
ListFromEnum makes a List out of any Enumeration.
 o main(String[])
test program for lists etc.
 o member(Object, List)
member(A, L) tells whether A is a member of L
 o nonEmpty()
nonEmpty() tells whether the List is non-empty.
 o nth(long)
nth selects List item by index (0, 1, 2, ...).
 o prefix(long, List)
prefix creates the length-n prefix of a List.
 o range(long, long)
range(M, N) returns a List of the form (M M+1 ....
 o range(long, long, long)
range(M, N, S) returns a List of the form (M M+S ....
 o rest()
rest() returns the rest of a non-empty List.
 o rest(List)
rest(L) returns the rest of its argument.
 o reverse(List)
reverse(L) returns the reverse of List L.
 o second()
second selects the second element of a List.
 o sixth()
sixth selects the sixth element of a List.
 o third()
third selects the third element of a List.
 o toString()
toString converts the list to a string using S expression formatting

Variables

 o nil
  public final static List nil
nil is the empty-list constant
 o nats
  public static List nats
 o primes
  public static List primes

Constructors

 o List
  public List()

Methods

 o isEmpty
  public abstract boolean isEmpty()
isEmpty() tells whether the List is empty.
 o nonEmpty
  public abstract boolean nonEmpty()
nonEmpty() tells whether the List is non-empty.
 o first
  public abstract Object first() throws EmptyListException
first() returns the first element of a non-empty List.
Throws: EmptyListException
Can't take first of an empty List.
 o rest
  public abstract List rest() throws EmptyListException
rest() returns the rest of a non-empty List.
Throws: EmptyListException
Can't take rest of an empty List.
 o getNonEmpty
  public abstract NonEmptyList getNonEmpty() throws EmptyListException
getNonEmpty() gets a NonEmptyList from a List
Throws: EmptyListException
is thrown if the list is empty after all
 o toString
  public abstract String toString()
toString converts the list to a string using S expression formatting
Overrides:
toString in class Object
 o cons
  public static List cons(Object First,
                          List Rest)
cons returns a new List given a First and a Rest.
 o cons
  public static List cons(Object First,
                          Seed Rest)
This variant of cons takes a Seed instead of a List as rest, so the list can be grown incrementally.
 o ListFromEnum
  public static List ListFromEnum(Enumeration e)
ListFromEnum makes a List out of any Enumeration.
 o list
  public static List list()
list(A, B, C, ...) returns a list made of specific elements. There is one function of each number of elements, up to 16 elements.
 o list
  public static List list(Object A)
 o list
  public static List list(Object A,
                          Object B)
 o list
  public static List list(Object A,
                          Object B,
                          Object C)
 o list
  public static List list(Object A,
                          Object B,
                          Object C,
                          Object D)
 o list
  public static List list(Object A,
                          Object B,
                          Object C,
                          Object D,
                          Object E)
 o list
  public static List list(Object A,
                          Object B,
                          Object C,
                          Object D,
                          Object E,
                          Object F)
 o list
  public static List list(Object A,
                          Object B,
                          Object C,
                          Object D,
                          Object E,
                          Object F,
                          Object G)
 o list
  public static List list(Object A,
                          Object B,
                          Object C,
                          Object D,
                          Object E,
                          Object F,
                          Object G,
                          Object H)
 o list
  public static List list(Object A,
                          Object B,
                          Object C,
                          Object D,
                          Object E,
                          Object F,
                          Object G,
                          Object H,
                          Object I)
 o list
  public static List list(Object A,
                          Object B,
                          Object C,
                          Object D,
                          Object E,
                          Object F,
                          Object G,
                          Object H,
                          Object I,
                          Object J)
 o list
  public static List list(Object A,
                          Object B,
                          Object C,
                          Object D,
                          Object E,
                          Object F,
                          Object G,
                          Object H,
                          Object I,
                          Object J,
                          Object K)
 o list
  public static List list(Object A,
                          Object B,
                          Object C,
                          Object D,
                          Object E,
                          Object F,
                          Object G,
                          Object H,
                          Object I,
                          Object J,
                          Object K,
                          Object L)
 o list
  public static List list(Object A,
                          Object B,
                          Object C,
                          Object D,
                          Object E,
                          Object F,
                          Object G,
                          Object H,
                          Object I,
                          Object J,
                          Object K,
                          Object L,
                          Object M)
 o list
  public static List list(Object A,
                          Object B,
                          Object C,
                          Object D,
                          Object E,
                          Object F,
                          Object G,
                          Object H,
                          Object I,
                          Object J,
                          Object K,
                          Object L,
                          Object M,
                          Object N)
 o list
  public static List list(Object A,
                          Object B,
                          Object C,
                          Object D,
                          Object E,
                          Object F,
                          Object G,
                          Object H,
                          Object I,
                          Object J,
                          Object K,
                          Object L,
                          Object M,
                          Object N,
                          Object O)
 o list
  public static List list(Object A,
                          Object B,
                          Object C,
                          Object D,
                          Object E,
                          Object F,
                          Object G,
                          Object H,
                          Object I,
                          Object J,
                          Object K,
                          Object L,
                          Object M,
                          Object N,
                          Object O,
                          Object P)
 o length
  public int length()
 o elements
  public ListEnum elements()
elements() returns a ListEnum object, which implements the interface java.util.Enumeration.
 o first
  public static Object first(List L) throws EmptyListException
first(L) returns the first element of its argument.
Throws: EmptyListException
Can't take first of empty List.
 o rest
  public static List rest(List L) throws EmptyListException
rest(L) returns the rest of its argument.
Throws: EmptyListException
Can't take rest of empty List.
 o reverse
  public static List reverse(List L)
reverse(L) returns the reverse of List L.
 o append
  public static List append(List L,
                            List M)
append(L, M) returns a List consisting of the elements of L followed by those of M.
 o member
  public static boolean member(Object A,
                               List L)
member(A, L) tells whether A is a member of L
 o range
  public static List range(long M,
                           long N)
range(M, N) returns a List of the form (M M+1 .... N)
 o range
  public static List range(long M,
                           long N,
                           long S)
range(M, N, S) returns a List of the form (M M+S .... N)
 o second
  public Object second() throws EmptyListException
second selects the second element of a List.
Throws: EmptyListException
Can't take second of List.
 o third
  public Object third() throws EmptyListException
third selects the third element of a List.
Throws: EmptyListException
Can't take third of List.
 o fourth
  public Object fourth() throws EmptyListException
fourth selects the fourth element of a List.
Throws: EmptyListException
Can't take fourth of List.
 o fifth
  public Object fifth() throws EmptyListException
fifth selects the fifth element of a List.
Throws: EmptyListException
Can't take fifth of List
 o sixth
  public Object sixth() throws EmptyListException
sixth selects the sixth element of a List.
Throws: EmptyListException
Can't take sixth of List
 o nth
  public Object nth(long n) throws EmptyListException
nth selects List item by index (0, 1, 2, ...).
Throws: EmptyListException
Can't select from an empty List.
 o prefix
  public static List prefix(long n,
                            List L)
prefix creates the length-n prefix of a List.
 o coprefix
  public static List coprefix(long n,
                              List L)
coprefix creates the list with all but the length-n prefix of a list
 o equals
  public static boolean equals(List L,
                               List M)
equals(L, M) tells whether Lists L and M are equal
 o equals
  public boolean equals(List M)
equals(M) tells whether this List is equal to some other
 o main
  public static void main(String args[])
test program for lists etc.
 o analysis
  public static String analysis(Object Ob)
analysis produces a string analyzing objects, especially Lists
 o array
  public Object[] array()
array() returns an array of elements in list

All Packages  Class Hierarchy  This Package  Previous  Next  Index