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(). 
  

Variable Index

 o nil
nil is the empty-list constant

Constructor Index

 o Polylist()
construct empty Polylist

Method Index

 o analysis(Object)
analysis produces a string analyzing objects, especially Polylists
 o append(Polylist)
append(M) returns a Polylist consisting of the elements of this followed by those of M.
 o array()
array() returns an array of elements in list
 o cons(Object)
cons returns a new Polylist given a First and this as a Rest
 o cons(Object, Polylist)
static cons returns a new Polylist given a First and a Rest.
 o cons(Object, Seed)
This variant of cons takes a Seed instead of a Polylist as rest, so the list can be grown incrementally.
 o coprefix(long)
coprefix creates the Polylist with all but the length-n prefix of a Polylist
 o elements()
elements() returns a PolylistEnum object, which implements the interface java.util.Enumeration.
 o equals(Polylist)
equals(M) tells whether this Polylist is equal to some other
 o equals(Polylist, Polylist)
equals(L, M) tells whether Polylists L and M are equal
 o explode(String)
explode(String S) converts a string into a Polylist of Character
 o fifth()
fifth selects the fifth element of a Polylist.
 o first()
first() returns the first element of a non-empty Polylist.
 o first(Polylist)
first(L) returns the first element of its argument.
 o fourth()
fourth selects the fourth element of a Polylist.
 o implode()
implode() creates a String from a Polylist of items
 o isEmpty()
isEmpty() tells whether the Polylist 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 main(String[])
test program for Polylists etc.
 o map(Function1)
map maps an object of class Function1 over a Polylist returning a Polylist
 o member(Object)
member(A, L) tells whether A is a member of this
 o nonEmpty()
nonEmpty() tells whether the Polylist is non-empty.
 o nth(long)
nth selects Polylist item by index (0, 1, 2, ...).
 o PolylistFromArray(Object[])
PolylistFromArray makes a list out of an array of objects
 o PolylistFromEnum(Enumeration)
PolylistFromEnum makes a Polylist out of any Enumeration.
 o prefix(long)
prefix creates the length-n prefix of a Polylist.
 o range(long, long)
range(M, N) returns a Polylist of the form (M M+1 ....
 o range(long, long, long)
range(M, N, S) returns a Polylist of the form (M M+S ....
 o rest()
rest() returns the rest of a non-empty Polylist.
 o rest(Polylist)
rest(L) returns the rest of its argument.
 o reverse()
reverse(L) returns the reverse of this
 o second()
second selects the second element of a Polylist.
 o sixth()
sixth selects the sixth element of a Polylist.
 o third()
third selects the third element of a Polylist.
 o toString()
toString() converts Polylist to string, e.g.

Variables

 o nil
  public final static Polylist nil
nil is the empty-list constant

Constructors

 o Polylist
  public Polylist()
construct empty Polylist

Methods

 o isEmpty
  public boolean isEmpty()
isEmpty() tells whether the Polylist is empty.
 o nonEmpty
  public boolean nonEmpty()
nonEmpty() tells whether the Polylist is non-empty.
 o first
  public Object first()
first() returns the first element of a non-empty Polylist.
Throws: NullPointerException
Can't take first of an empty Polylist.
 o rest
  public Polylist rest()
rest() returns the rest of a non-empty Polylist.
Throws: NullPointerException
Can't take rest of an empty Polylist.
 o toString
  public String toString()
toString() converts Polylist to string, e.g. for printing
Overrides:
toString in class Object
 o cons
  public Polylist cons(Object First)
cons returns a new Polylist given a First and this as a Rest
 o cons
  public static Polylist cons(Object First,
                              Polylist Rest)
static cons returns a new Polylist given a First and a Rest.
 o 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.
 o PolylistFromEnum
  public static Polylist PolylistFromEnum(Enumeration e)
PolylistFromEnum makes a Polylist out of any Enumeration.
 o 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.
 o list
  public static Polylist list(Object A)
 o list
  public static Polylist list(Object A,
                              Object B)
 o list
  public static Polylist list(Object A,
                              Object B,
                              Object C)
 o list
  public static Polylist list(Object A,
                              Object B,
                              Object C,
                              Object D)
 o list
  public static Polylist list(Object A,
                              Object B,
                              Object C,
                              Object D,
                              Object E)
 o list
  public static Polylist list(Object A,
                              Object B,
                              Object C,
                              Object D,
                              Object E,
                              Object F)
 o list
  public static Polylist list(Object A,
                              Object B,
                              Object C,
                              Object D,
                              Object E,
                              Object F,
                              Object G)
 o list
  public static Polylist list(Object A,
                              Object B,
                              Object C,
                              Object D,
                              Object E,
                              Object F,
                              Object G,
                              Object H)
 o list
  public static Polylist list(Object A,
                              Object B,
                              Object C,
                              Object D,
                              Object E,
                              Object F,
                              Object G,
                              Object H,
                              Object I)
 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)
 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)
 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)
 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)
 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)
 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)
 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)
 o length
  public int length()
 o elements
  public PolylistEnum elements()
elements() returns a PolylistEnum object, which implements the interface java.util.Enumeration.
 o 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.
 o rest
  public static Polylist rest(Polylist L)
rest(L) returns the rest of its argument.
Throws: NullPointerException
Can't take rest of empty Polylist.
 o reverse
  public Polylist reverse()
reverse(L) returns the reverse of this
 o append
  public Polylist append(Polylist M)
append(M) returns a Polylist consisting of the elements of this followed by those of M.
 o member
  public boolean member(Object A)
member(A, L) tells whether A is a member of this
 o range
  public static Polylist range(long M,
                               long N)
range(M, N) returns a Polylist of the form (M M+1 .... N)
 o 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)
 o second
  public Object second()
second selects the second element of a Polylist.
Throws: NullPointerException
Can't take second of Polylist.
 o third
  public Object third()
third selects the third element of a Polylist.
Throws: NullPointerException
Can't take third of Polylist.
 o fourth
  public Object fourth()
fourth selects the fourth element of a Polylist.
Throws: NullPointerException
Can't take fourth of Polylist.
 o fifth
  public Object fifth()
fifth selects the fifth element of a Polylist.
Throws: NullPointerException
Can't take fifth of Polylist
 o sixth
  public Object sixth()
sixth selects the sixth element of a Polylist.
Throws: NullPointerException
Can't take sixth of Polylist
 o nth
  public Object nth(long n)
nth selects Polylist item by index (0, 1, 2, ...).
Throws: NullPointerException
Can't select from an empty Polylist.
 o prefix
  public Polylist prefix(long n)
prefix creates the length-n prefix of a Polylist.
 o coprefix
  public Polylist coprefix(long n)
coprefix creates the Polylist with all but the length-n prefix of a Polylist
 o equals
  public static boolean equals(Polylist L,
                               Polylist M)
equals(L, M) tells whether Polylists L and M are equal
 o equals
  public boolean equals(Polylist M)
equals(M) tells whether this Polylist is equal to some other
 o main
  public static void main(String args[])
test program for Polylists etc.
 o analysis
  public static String analysis(Object Ob)
analysis produces a string analyzing objects, especially Polylists
 o array
  public Object[] array()
array() returns an array of elements in list
 o PolylistFromArray
  public static Polylist PolylistFromArray(Object array[])
PolylistFromArray makes a list out of an array of objects
 o explode
  public static Polylist explode(String S)
explode(String S) converts a string into a Polylist of Character
 o implode
  public String implode()
implode() creates a String from a Polylist of items
 o 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