Method Summary |
|
public JMLListEqualsNode | 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 JMLListEqualsNode | concat(JMLListEqualsNode 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 JMLListEqualsNode | cons(Object hd, JMLListEqualsNode tl) Return a JMLListEqualsNode 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 ".equals" 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 ".equals" 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 JMLListEqualsNode | 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(JMLListEqualsNode ls2) Tells whether the elements of this list occur, in
order, at the beginning of the given list, using ".equals" 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 JMLListEqualsNode | 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 JMLListEqualsNode | prepend(Object item) Return a list that is like this, but with the given item at
the front. |
public JMLListEqualsNode | remove(Object item) Return a list that is like this list but without the first
occurrence of the given item. |
public JMLListEqualsNode | 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 JMLListEqualsNode | removeLast() Return a list containing all but the last element in this. |
public JMLListEqualsNode | removePrefix(int n) Return a list containing all but the first n elements in this list. |
public JMLListEqualsNode | replaceItemAt(int n, Object item) Return a list like this, but with item replacing the element at the
given zero-based index. |
public JMLListEqualsNode | reverse() Return a list that is the reverse of this list. |
public String | toString() Return a string representation for this list. |