Class polya.Polylist
All Packages Class Hierarchy This Package Previous Next Index
Class polya.Polylist
java.lang.Object
|
+----polya.Polylist
- public class Polylist
- extends Object
Polylist is the basic unit for constructing an open linked list of Objects.
A Polylist can be either :
empty, or
non-empty, in which case it consists of:
a Object as the first thing in the list
a rest which is a Polylist.
A Polylist can also be a Incremental, which may be converted into an
ordinary Polylist by applying methods such as isEmpty(), first(), and
rest().
-
nil
- nil is the empty-list constant
-
Polylist()
- construct empty Polylist
-
analysis(Object)
- analysis produces a string analyzing objects, especially Polylists
-
append(Polylist)
- append(M) returns a Polylist consisting of the elements of this
followed by those of M.
-
array()
- array() returns an array of elements in list
-
cons(Object)
- cons returns a new Polylist given a First and this as a Rest
-
cons(Object, Polylist)
- static cons returns a new Polylist given a First and a Rest.
-
cons(Object, Seed)
- This variant of cons takes a Seed instead of a Polylist as rest, so
the list can be grown incrementally.
-
coprefix(long)
- coprefix creates the Polylist with all but the length-n prefix of
a Polylist
-
elements()
- elements() returns a PolylistEnum object, which implements the
interface java.util.Enumeration.
-
equals(Polylist)
- equals(M) tells whether this Polylist is equal to some other
-
equals(Polylist, Polylist)
- equals(L, M) tells whether Polylists L and M are equal
-
explode(String)
- explode(String S) converts a string into a Polylist of Character
-
fifth()
- fifth selects the fifth element of a Polylist.
-
first()
- first() returns the first element of a non-empty Polylist.
-
first(Polylist)
- first(L) returns the first element of its argument.
-
fourth()
- fourth selects the fourth element of a Polylist.
-
implode()
- implode() creates a String from a Polylist of items
-
isEmpty()
- isEmpty() tells whether the Polylist 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)
-
-
main(String[])
- test program for Polylists etc.
-
map(Function1)
- map maps an object of class Function1 over a Polylist returning a
Polylist
-
member(Object)
- member(A, L) tells whether A is a member of this
-
nonEmpty()
- nonEmpty() tells whether the Polylist is non-empty.
-
nth(long)
- nth selects Polylist item by index (0, 1, 2, ...).
-
PolylistFromArray(Object[])
- PolylistFromArray makes a list out of an array of objects
-
PolylistFromEnum(Enumeration)
- PolylistFromEnum makes a Polylist out of any Enumeration.
-
prefix(long)
- prefix creates the length-n prefix of a Polylist.
-
range(long, long)
- range(M, N) returns a Polylist of the form (M M+1 ....
-
range(long, long, long)
- range(M, N, S) returns a Polylist of the form (M M+S ....
-
rest()
- rest() returns the rest of a non-empty Polylist.
-
rest(Polylist)
- rest(L) returns the rest of its argument.
-
reverse()
- reverse(L) returns the reverse of this
-
second()
- second selects the second element of a Polylist.
-
sixth()
- sixth selects the sixth element of a Polylist.
-
third()
- third selects the third element of a Polylist.
-
toString()
- toString() converts Polylist to string, e.g.
nil
public final static Polylist nil
- nil is the empty-list constant
Polylist
public Polylist()
- construct empty Polylist
isEmpty
public boolean isEmpty()
- isEmpty() tells whether the Polylist is empty.
nonEmpty
public boolean nonEmpty()
- nonEmpty() tells whether the Polylist is non-empty.
first
public Object first()
- first() returns the first element of a non-empty Polylist.
- Throws: NullPointerException
- Can't take first of an empty Polylist.
rest
public Polylist rest()
- rest() returns the rest of a non-empty Polylist.
- Throws: NullPointerException
- Can't take rest of an empty Polylist.
toString
public String toString()
- toString() converts Polylist to string, e.g. for printing
- Overrides:
- toString in class Object
cons
public Polylist cons(Object First)
- cons returns a new Polylist given a First and this as a Rest
cons
public static Polylist cons(Object First,
Polylist Rest)
- static cons returns a new Polylist given a First and a Rest.
cons
public static Polylist cons(Object First,
Seed Rest)
- This variant of cons takes a Seed instead of a Polylist as rest, so
the list can be grown incrementally.
PolylistFromEnum
public static Polylist PolylistFromEnum(Enumeration e)
- PolylistFromEnum makes a Polylist out of any Enumeration.
list
public static Polylist 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 Polylist list(Object A)
list
public static Polylist list(Object A,
Object B)
list
public static Polylist list(Object A,
Object B,
Object C)
list
public static Polylist list(Object A,
Object B,
Object C,
Object D)
list
public static Polylist list(Object A,
Object B,
Object C,
Object D,
Object E)
list
public static Polylist list(Object A,
Object B,
Object C,
Object D,
Object E,
Object F)
list
public static Polylist list(Object A,
Object B,
Object C,
Object D,
Object E,
Object F,
Object G)
list
public static Polylist list(Object A,
Object B,
Object C,
Object D,
Object E,
Object F,
Object G,
Object H)
list
public static Polylist list(Object A,
Object B,
Object C,
Object D,
Object E,
Object F,
Object G,
Object H,
Object I)
list
public static Polylist list(Object A,
Object B,
Object C,
Object D,
Object E,
Object F,
Object G,
Object H,
Object I,
Object J)
list
public static Polylist 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 Polylist 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 Polylist 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 Polylist 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 Polylist 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 Polylist 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 PolylistEnum elements()
- elements() returns a PolylistEnum object, which implements the
interface java.util.Enumeration.
first
public static Object first(Polylist L)
- first(L) returns the first element of its argument.
- Throws: NullPointerException
- Can't take first of empty List.
rest
public static Polylist rest(Polylist L)
- rest(L) returns the rest of its argument.
- Throws: NullPointerException
- Can't take rest of empty Polylist.
reverse
public Polylist reverse()
- reverse(L) returns the reverse of this
append
public Polylist append(Polylist M)
- append(M) returns a Polylist consisting of the elements of this
followed by those of M.
member
public boolean member(Object A)
- member(A, L) tells whether A is a member of this
range
public static Polylist range(long M,
long N)
- range(M, N) returns a Polylist of the form (M M+1 .... N)
range
public static Polylist range(long M,
long N,
long S)
- range(M, N, S) returns a Polylist of the form (M M+S .... N)
second
public Object second()
- second selects the second element of a Polylist.
- Throws: NullPointerException
- Can't take second of Polylist.
third
public Object third()
- third selects the third element of a Polylist.
- Throws: NullPointerException
- Can't take third of Polylist.
fourth
public Object fourth()
- fourth selects the fourth element of a Polylist.
- Throws: NullPointerException
- Can't take fourth of Polylist.
fifth
public Object fifth()
- fifth selects the fifth element of a Polylist.
- Throws: NullPointerException
- Can't take fifth of Polylist
sixth
public Object sixth()
- sixth selects the sixth element of a Polylist.
- Throws: NullPointerException
- Can't take sixth of Polylist
nth
public Object nth(long n)
- nth selects Polylist item by index (0, 1, 2, ...).
- Throws: NullPointerException
- Can't select from an empty Polylist.
prefix
public Polylist prefix(long n)
- prefix creates the length-n prefix of a Polylist.
coprefix
public Polylist coprefix(long n)
- coprefix creates the Polylist with all but the length-n prefix of
a Polylist
equals
public static boolean equals(Polylist L,
Polylist M)
- equals(L, M) tells whether Polylists L and M are equal
equals
public boolean equals(Polylist M)
- equals(M) tells whether this Polylist is equal to some other
main
public static void main(String args[])
- test program for Polylists etc.
analysis
public static String analysis(Object Ob)
- analysis produces a string analyzing objects, especially Polylists
array
public Object[] array()
- array() returns an array of elements in list
PolylistFromArray
public static Polylist PolylistFromArray(Object array[])
- PolylistFromArray makes a list out of an array of objects
explode
public static Polylist explode(String S)
- explode(String S) converts a string into a Polylist of Character
implode
public String implode()
- implode() creates a String from a Polylist of items
map
public Polylist map(Function1 F)
- map maps an object of class Function1 over a Polylist returning a
Polylist
All Packages Class Hierarchy This Package Previous Next Index