antlr.collections.impl
Class LList
java.lang.Object
antlr.collections.impl.LList
- List, Stack
public class LList
extends java.lang.Object
A Linked List Implementation (not thread-safe for simplicity)
(adds to the tail) (has an enumeration)
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()
|
length
protected int length
add
public void add(Object o)
Add an object to the end of the list.
- add in interface List
append
public void append(Object o)
Append an object to the end of the list.
- append in interface List
deleteHead
protected Object deleteHead()
throws NoSuchElementException
Delete the object at the head of the list.
- the object found at the head of the list.
elementAt
public Object elementAt(int i)
throws NoSuchElementException
Get the ith element in the list.
- elementAt in interface List
i
- the index (from 0) of the requested element.
- the object at index i
NoSuchElementException is thrown if i out of range
elements
public Enumeration elements()
Return an enumeration of the list elements
- elements in interface List
height
public int height()
How high is the stack?
- height in interface Stack
includes
public boolean includes(Object o)
Answers whether or not an object is contained in the list
- includes in interface List
o
- the object to test for inclusion.
- true if object is contained else false.
insertHead
protected void insertHead(Object o)
Insert an object at the head of the list.
length
public int length()
Return the length of the list.
- length in interface List
pop
public Object pop()
throws NoSuchElementException
Pop the top element of the stack off.
- pop in interface Stack
- the top of stack that was popped off.
push
public void push(Object o)
Push an object onto the stack.
- push in interface Stack
top
public Object top()
throws NoSuchElementException
- top in interface Stack