Inheritance diagram for OpenList::

Public Methods | |
| OpenList | cons (Object _First) |
| Object | first () throws OpenListException |
| OpenList | rest () throws OpenListException |
| boolean | isEmpty () |
| boolean | nonEmpty () |
| OpenList | append (OpenList L2) |
| boolean | member (Object Ob) |
| OpenList | reverse () |
| int | length () |
| Object | nth (int n) throws OpenListException |
| OpenList | prefix (int n) |
| Object | second () throws OpenListException |
| Object | third () throws OpenListException |
| boolean | equals (Object Ob) |
| Object | clone () |
| OpenList | map (Function1 f) |
| Object | reduce (Function2 b, Object u) |
| String | toString () |
| String | toString (String leftParen, String spacer, String rightParen) |
| String | implode () |
| Object [] | toArray () |
| OpenList | sort (java.util.Comparator comparator) |
| Enumeration | elements () |
Static Public Methods | |
| OpenList | cons (Object _First, OpenList _Rest) |
| Object | first (OpenList List) throws OpenListException |
| OpenList | rest (OpenList List) throws OpenListException |
| boolean | isEmpty (OpenList List) |
| boolean | nonEmpty (OpenList List) |
| OpenList | append (OpenList L1, OpenList L2) |
| boolean | member (Object Ob, OpenList L) |
| OpenList | reverse (OpenList L1) |
| int | length (OpenList L) |
| Object | nth (int n, OpenList L) throws OpenListException |
| OpenList | prefix (int n, OpenList L) |
| Object | second (OpenList L) throws OpenListException |
| Object | third (OpenList L) throws OpenListException |
| OpenList | list () |
| OpenList | list (Object First) |
| OpenList | list (Object First, Object Second) |
| OpenList | list (Object First, Object Second, Object Third) |
| OpenList | list (Object First, Object Second, Object Third, Object Fourth) |
| OpenList | list (Object First, Object Second, Object Third, Object Fourth, Object Fifth) |
| OpenList | list (Object First, Object Second, Object Third, Object Fourth, Object Fifth, Object Sixth) |
| OpenList | list (Object First, Object Second, Object Third, Object Fourth, Object Fifth, Object Sixth, Object Seventh) |
| boolean | equals (OpenList L1, OpenList L2) |
| OpenList | map (Function1 f, OpenList L) |
| OpenList | mappend (Function1 f, OpenList L) |
| Object | reduce (Function2 b, Object u, OpenList L) |
| OpenList | assoc (Object X, OpenList L) |
| OpenList | explode (String s) |
| String | implode (OpenList L) |
| Object [] | toArray (OpenList L) |
| OpenList | fromArray (Object a[]) |
| OpenList | readLines (BufferedReader reader) throws IOException |
| OpenList | solidify (Enumeration E) |
| void | main (String arg[]) |
Static Public Attributes | |
| final OpenList | nil = cons(null, null) |
| String | defaultLeftParen = "[" |
| String | defaultRightParen = "]" |
| String | defaultSpacer = ", " |
| String | firstException = "first() of empty list" |
| String | restException = "rest() of empty list" |
| String | nthException = "nth of an OpenList of length " |
| String | wherePart = ", where n == " |
| String | secondException |
| String | thirdException = "third of an OpenList, where length() = " |
Definition at line 14 of file OpenList.java.
|
|
Create a new list formed by elements of this list followed by those of the argument list.
Definition at line 280 of file OpenList.java. |
|
|
Create a new list formed by elements of the first argument followed by those of the second.
Definition at line 258 of file OpenList.java. |
|
|
Find out whether the first argument occurs as the first element of any pair in the second argument, an association list. If it does, return the entire pair. If not, return the empty list.
assoc(S, []) => []; assoc(S, [[S, T] | L]) => [S, T]; assoc(S, [_ | L]) => assoc(S, L); * Definition at line 859 of file OpenList.java. |
|
|
Return a clone of this OpenList. Any Cloneable Objects in the list will be cloned in the result. Non-Cloneable Objects will be included as is.
Definition at line 741 of file OpenList.java. |
|
|
Return a new OpenList constructed from this list and a first.
Definition at line 126 of file OpenList.java. |
|
|
Return a new OpenList constructed from its first and rest.
Definition at line 113 of file OpenList.java. |
|
|
Return an Enumeration of the elements of this OpenList.
Definition at line 1083 of file OpenList.java. |
|
|
Return true if this list is equal to the argument list.
Definition at line 723 of file OpenList.java. |
|
|
Return true if the two OpenLists are equal, in the sense of having the equal elements in both listss.
Definition at line 693 of file OpenList.java. Referenced by main(). |
|
|
Explode the argument String into a list of Characters wrapping the characters of the String.
Definition at line 930 of file OpenList.java. |
|
|
Return the first of the argument, a non-empty OpenList.
Definition at line 157 of file OpenList.java. |
|
|
Return the first of this non-empty OpenList.
Definition at line 139 of file OpenList.java. Referenced by append(), assoc(), equals(), implode(), map(), mappend(), member(), OpenListEnumeration::nextElement(), nth(), reduce(), reverse(), toArray(), and toString(). |
|
|
Create an OpenList from an array of Objects.
Definition at line 1024 of file OpenList.java. |
|
|
Implode this OpenList into a single String. The list can contain any Objects, not just Characters. The toString method is used to get the character representation of the object. No parentheses or spacing is added around or between the elements of the outer list.
Definition at line 978 of file OpenList.java. |
|
|
Implode the contents of an OpenList into a single String. The list can contain any Objects, not just Characters. The toString method is used to get the character representation of the object. No parentheses or spacing is added around or between the elements of the outer list. If these are wanted, use the toString method rather than implode.
Definition at line 955 of file OpenList.java. |
|
|
Return true if the argument list is empty, false otherwise. Note: Done by comparing this list to nil, which should be the only way to determine whether the list is empty.
Definition at line 229 of file OpenList.java. |
|
|
Return true if this list is empty, false otherwise. Note: Done by comparing this list to nil, which should be the only way to determine whether the list is empty.
Definition at line 203 of file OpenList.java. Referenced by append(), equals(), isEmpty(), map(), mappend(), and OpenListEnumeration::nextElement(). |
|
|
Return the number of elements of this list.
Definition at line 381 of file OpenList.java. |
|
|
Return the number of elements of the argument list.
Definition at line 362 of file OpenList.java. |
|
|
Return the list consisting of the argument objects.
Definition at line 672 of file OpenList.java. |
|
|
Return the list consisting of the argument objects.
Definition at line 648 of file OpenList.java. |
|
|
Return the list consisting of the argument objects.
Definition at line 626 of file OpenList.java. |
|
|
Return the list consisting of the argument objects.
Definition at line 606 of file OpenList.java. |
|
|
Return the list consisting of the argument objects.
Definition at line 590 of file OpenList.java. |
|
|
Return the list consisting of the argument objects.
Definition at line 574 of file OpenList.java. |
|
|
Return the list consisting of the argument objects.
Definition at line 560 of file OpenList.java. |
|
|
Return the list consisting of the argument objects, in this case the empty list.
Definition at line 547 of file OpenList.java. |
|
|
test program: exercises a variety of the defined methods, printing out results Definition at line 1113 of file OpenList.java. |
|
|
Map a Function1 f over this OpenList.
Definition at line 779 of file OpenList.java. |
|
|
Map a Function1 function object f over an OpenList L.
Definition at line 759 of file OpenList.java. |
|
|
Map a Function1 function object f over an OpenList L, where the function is expected to produce a list for each object, then append the results together to get an overall list.
Definition at line 796 of file OpenList.java. |
|
|
Return true if the first argument is a member (in the sense of being equals) of this OpenList
Definition at line 316 of file OpenList.java. |
|
|
Return true if the first argument is a member (in the sense of being equals) of the second argument list
Definition at line 296 of file OpenList.java. |
|
|
Return true if the argument list is non-empty, false otherwise.
Definition at line 242 of file OpenList.java. |
|
|
Return true if this list is non-empty, false otherwise.
Definition at line 214 of file OpenList.java. Referenced by assoc(), equals(), OpenListEnumeration::hasMoreElements(), implode(), length(), member(), nonEmpty(), reduce(), reverse(), toArray(), and toString(). |
|
|
Return the nth element of this list, starting with n = 0, 1, 2, ... If there is no nth element, throws an EmptyList exception so indicating.
Definition at line 430 of file OpenList.java. |
|
|
Return the nth element of the second argument list, starting with n = 0, 1, 2, ... If there is no nth element, throws an OpenListException so indicating.
Definition at line 399 of file OpenList.java. Referenced by main(). |
|
|
Returns the first n elements of an OpenList. If there aren't n elements in the list, returns the entire list. If n <= 0, returns nil.
Definition at line 466 of file OpenList.java. |
|
|
Returns the first n elements of this OpenList. If there aren't n elements in the list, returns the entire list. If n <= 0, returns nil.
Definition at line 445 of file OpenList.java. |
|
|
Read lines from a BufferedReader, each as a separate String. The lines read are returned as an OpenList of Strings.
Definition at line 1067 of file OpenList.java. |
|
|
Reduce this OpenList using Function2 b and unit u.
Definition at line 839 of file OpenList.java. |
|
|
Reduce an OpenList using Function2 b and unit u.
Definition at line 819 of file OpenList.java. |
|
|
Return the rest, i.e. all a list of all but the first of the argument non-empty OpenList.
Definition at line 190 of file OpenList.java. |
|
|
Return the rest, i.e. all a list of all but the first of this non-empty OpenList.
Definition at line 171 of file OpenList.java. Referenced by append(), assoc(), equals(), implode(), length(), map(), mappend(), member(), OpenListEnumeration::nextElement(), nth(), reduce(), reverse(), toArray(), and toString(). |
|
|
Return a new list containing the elements of the argument this list in reverse order.
Definition at line 350 of file OpenList.java. |
|
|
Return a new list containing the elements of the argument list in reverse order.
Definition at line 330 of file OpenList.java. |
|
|
Return the second element of the argument OpenList, assuming it has one.
Definition at line 520 of file OpenList.java. |
|
|
Return the second element of this OpenList, assuming it has one.
Definition at line 479 of file OpenList.java. Referenced by second(). |
|
|
Create an OpenList of the elements from an Enumeration.
Definition at line 1095 of file OpenList.java. |
|
|
Return a sorted version of this list, as determined by the Comparator, using the Quicksort algorithm
Definition at line 1047 of file OpenList.java. |
|
|
Return the third element of the argument OpenList, assuming it has one.
Definition at line 534 of file OpenList.java. |
|
|
Return the third element of this OpenList, assuming it has one.
Definition at line 499 of file OpenList.java. Referenced by third(). |
|
|
Return an array of the Objects in this OpenList.
Definition at line 1012 of file OpenList.java. |
|
|
Return an array of the Objects in the argument OpenList.
Definition at line 991 of file OpenList.java. |
|
|
Convert this OpenList to a String, using the arguments as punctuation.
Definition at line 896 of file OpenList.java. |
|
|
Convert this OpenList to a String, using default punctuation.
Definition at line 881 of file OpenList.java. |
|
|
the default left paren used when a list is printed. Defaults are used when the toString() method is called, i.e. whenever an OpenList is automatically cast to a String, as in printing. To use different punctuation, or no punctuation, use the three-argument toString, and supply the punctuation you want. Definition at line 36 of file OpenList.java. |
|
|
the default right paren used when a list is printed Definition at line 41 of file OpenList.java. |
|
|
the default space used when a list is printed Definition at line 46 of file OpenList.java. |
|
|
exception message for first of empty list Definition at line 51 of file OpenList.java. |
|
|
the one and only empty OpenList. Do not create any others. This list is represented by a unique cell allocated for the purpose. The first and rest are not intended to be used. We do not use null for this list, so that we can call methods on it. We do not create other empty lists so that our implementation of isEmpty() works by comparing references. Definition at line 25 of file OpenList.java. |
|
|
exception message for nth of a list Definition at line 61 of file OpenList.java. |
|
|
exception message for rest of empty list Definition at line 56 of file OpenList.java. |
|
|
Initial value:
"second of an OpenList, where length() = "Definition at line 71 of file OpenList.java. |
|
|
exception message for third of a list Definition at line 77 of file OpenList.java. |
|
|
part of exception message for nth of a list Definition at line 66 of file OpenList.java. |
1.2.6 written by Dimitri van Heesch,
© 1997-2001