Method Summary |
|
public JMLListObjectNode | append(Object item) Return a list that consists of this list and the given element. |
public Object | clone() Return a clone of this object. |
public JMLListObjectNode | concat(JMLListObjectNode ls2) Return a list that is the concatenation of this with the given
lists.
Parameters: ls2 - the list to place at the end of this list in theresult. |
public static JMLListObjectNode | cons(Object hd, JMLListObjectNode tl) Return a JMLListObjectNode containing the given element
followed by the given list.
Note that cons() adds elements to the front of a list. |
public boolean | equals(Object ls2) Test whether this object's value is equal to the given argument. |
public Object | getItem(Object item) Return the zero-based index of the first occurrence of the given
element in the list, if there is one
Parameters: item - the Object sought in this list. |
public boolean | has(Object item) Tells whether the given element is "==" to an
element in the list. |
public int | hashCode() Return a hash code for this object. |
public Object | head() Return the first element in this list. |
public boolean | headEquals(Object item) Tell if the head of the list is "==" to the given
item. |
public int | indexOf(Object item) Return the zero-based index of the first occurrence of the given
element in the list, if there is one
Parameters: item - the Object sought in this. |
public JMLListObjectNode | insertBefore(int n, Object item) Return a list that is like this list but with the given item
inserted before the given index. |
public int | int_length() Tells the number of elements in the list; a synonym for size. |
public int | int_size() Tells the number of elements in the list; a synonym for length. |
public boolean | isPrefixOf(JMLListObjectNode ls2) Tells whether the elements of this list occur, in
order, at the beginning of the given list, using "==" for
comparisons. |
public Object | itemAt(int i) Return the ith element of a list. |
public Object | last() Return the last element in this list. |
public JMLListObjectNode | prefix(int n) Return a list containing the first n elements in this list.
Parameters: n - the number of elements to leave in the result. |
public JMLListObjectNode | prepend(Object item) Return a list that is like this, but with the given item at
the front. |
public JMLListObjectNode | remove(Object item) Return a list that is like this list but without the first
occurrence of the given item. |
public JMLListObjectNode | removeItemAt(int n) Return a list like this list, but without the element at the
given zero-based index.
Parameters: n - the zero-based index into the list. |
public JMLListObjectNode | removeLast() Return a list containing all but the last element in this. |
public JMLListObjectNode | removePrefix(int n) Return a list containing all but the first n elements in this list. |
public JMLListObjectNode | replaceItemAt(int n, Object item) Return a list like this, but with item replacing the element at the
given zero-based index. |
public JMLListObjectNode | reverse() Return a list that is the reverse of this list. |
public String | toString() Return a string representation for this list. |