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