Package antlr.collections.impl
Class LList
- java.lang.Object
-
- antlr.collections.impl.LList
-
-
Constructor Summary
Constructors Constructor Description LList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Object o)Add an object to the end of the list.voidappend(Object o)Append an object to the end of the list.protected ObjectdeleteHead()Delete the object at the head of the list.ObjectelementAt(int i)Get the ith element in the list.Enumerationelements()Return an enumeration of the list elementsintheight()How high is the stack?booleanincludes(Object o)Answers whether or not an object is contained in the listprotected voidinsertHead(Object o)Insert an object at the head of the list.intlength()Return the length of the list.Objectpop()Pop the top element of the stack off.voidpush(Object o)Push an object onto the stack.Objecttop()
-
-
-
Method Detail
-
add
public void add(Object o)
Add an object to the end of the list.
-
append
public void append(Object o)
Append an object to the end of the list.
-
deleteHead
protected Object deleteHead() throws NoSuchElementException
Delete the object at the head of the list.- Returns:
- the object found at the head of the list.
- Throws:
NoSuchElementException- if the list is empty.
-
elementAt
public Object elementAt(int i) throws NoSuchElementException
Get the ith element in the list.- Specified by:
elementAtin interfaceList- Parameters:
i- the index (from 0) of the requested element.- Returns:
- the object at index i NoSuchElementException is thrown if i out of range
- Throws:
NoSuchElementException
-
elements
public Enumeration elements()
Return an enumeration of the list elements
-
includes
public boolean includes(Object o)
Answers whether or not an object is contained in the list
-
insertHead
protected void insertHead(Object o)
Insert an object at the head of the list.- Parameters:
o- the object to add
-
pop
public Object pop() throws NoSuchElementException
Pop the top element of the stack off.- Specified by:
popin interfaceStack- Returns:
- the top of stack that was popped off.
- Throws:
NoSuchElementException- if the stack is empty.
-
push
public void push(Object o)
Push an object onto the stack.
-
top
public Object top() throws NoSuchElementException
- Specified by:
topin interfaceStack- Throws:
NoSuchElementException
-
-