|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--antlr.collections.impl.LList
A Linked List Implementation (not thread-safe for simplicity) (adds to the tail) (has an enumeration)
| Field Summary | |
protected antlr.collections.impl.LLCell |
head
|
protected int |
length
|
protected antlr.collections.impl.LLCell |
tail
|
| Constructor Summary | |
LList()
|
|
| Method Summary | |
void |
add(Object o)
Add an object to the end of the list. |
void |
append(Object o)
Append an object to the end of the list. |
protected Object |
deleteHead()
Delete the object at the head of the list. |
Object |
elementAt(int i)
Get the ith element in the list. |
Enumeration |
elements()
Return an enumeration of the list elements |
int |
height()
How high is the stack? |
boolean |
includes(Object o)
Answers whether or not an object is contained in the list |
protected void |
insertHead(Object o)
Insert an object at the head of the list. |
int |
length()
Return the length of the list. |
Object |
pop()
Pop the top element of the stack off. |
void |
push(Object o)
Push an object onto the stack. |
Object |
top()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected antlr.collections.impl.LLCell head
protected antlr.collections.impl.LLCell tail
protected int length
| Constructor Detail |
public LList()
| Method Detail |
public void add(Object o)
add in interface Listo - the object to addpublic void append(Object o)
append in interface Listo - the object to append
protected Object deleteHead()
throws NoSuchElementException
NoSuchElementException - if the list is empty.
public Object elementAt(int i)
throws NoSuchElementException
elementAt in interface Listi - the index (from 0) of the requested element.
NoSuchElementExceptionpublic Enumeration elements()
elements in interface Listpublic int height()
height in interface Stackpublic boolean includes(Object o)
includes in interface Listo - the object to test for inclusion.
protected void insertHead(Object o)
o - the object to addpublic int length()
length in interface List
public Object pop()
throws NoSuchElementException
pop in interface StackNoSuchElementException - if the stack is empty.public void push(Object o)
push in interface Stacko - the object to push
public Object top()
throws NoSuchElementException
top in interface StackNoSuchElementException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||