java.lang.Objectantlr.collections.impl.LList
A Linked List Implementation (not thread-safe for simplicity) (adds to the tail) (has an enumeration)
Constructor Summary | |
LList()
|
Method Summary | |
void |
add(java.lang.Object o)
Add an object to the end of the list. |
void |
append(java.lang.Object o)
Append an object to the end of the list. |
java.lang.Object |
elementAt(int i)
Get the ith element in the list. |
java.util.Enumeration |
elements()
Return an enumeration of the list elements |
int |
height()
How high is the stack? |
boolean |
includes(java.lang.Object o)
Answers whether or not an object is contained in the list |
int |
length()
Return the length of the list. |
java.lang.Object |
pop()
Pop the top element of the stack off. |
void |
push(java.lang.Object o)
Push an object onto the stack. |
java.lang.Object |
top()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LList()
Method Detail |
public void add(java.lang.Object o)
add
in interface List
o
- the object to addpublic void append(java.lang.Object o)
append
in interface List
o
- the object to appendpublic java.lang.Object elementAt(int i) throws java.util.NoSuchElementException
elementAt
in interface List
i
- the index (from 0) of the requested element.
java.util.NoSuchElementException
public java.util.Enumeration elements()
elements
in interface List
public int height()
height
in interface Stack
public boolean includes(java.lang.Object o)
includes
in interface List
o
- the object to test for inclusion.
public int length()
length
in interface List
public java.lang.Object pop() throws java.util.NoSuchElementException
pop
in interface Stack
java.util.NoSuchElementException
- if the stack is empty.public void push(java.lang.Object o)
push
in interface Stack
o
- the object to pushpublic java.lang.Object top() throws java.util.NoSuchElementException
top
in interface Stack
java.util.NoSuchElementException