Modifier and Type | Field and Description |
---|---|
protected LLCell |
head |
protected int |
length |
protected LLCell |
tail |
Constructor and Description |
---|
LList() |
Modifier and Type | Method and Description |
---|---|
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.
|
protected java.lang.Object |
deleteHead()
Delete the object at the head 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
|
protected void |
insertHead(java.lang.Object o)
Insert an object at the head of 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() |
public void add(java.lang.Object o)
public void append(java.lang.Object o)
protected java.lang.Object deleteHead() throws java.util.NoSuchElementException
java.util.NoSuchElementException
- if the list is empty.public java.lang.Object elementAt(int i) throws java.util.NoSuchElementException
public java.util.Enumeration elements()
public boolean includes(java.lang.Object o)
protected void insertHead(java.lang.Object o)
o
- the object to addpublic java.lang.Object pop() throws java.util.NoSuchElementException
public void push(java.lang.Object o)