|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectclarion.tools.linkedlist.LinkedList
Nested Class Summary | |
protected static class |
LinkedList.Node
|
Field Summary | |
protected int |
count
|
protected LinkedList.Node |
head
|
protected LinkedList.Node |
tail
|
Constructor Summary | |
LinkedList()
|
Method Summary | |
java.lang.Object |
clone()
Creates a deep copy of this list. |
boolean |
equals(java.lang.Object other)
Checks whether some other object is equal to this one. |
int |
getCount()
Counts the number of elements in the list. |
java.lang.Object |
getFrom(int index)
Returns the element at the specified position in the list. |
java.lang.Object |
getHead()
Returns the first element in the list. |
java.lang.Object |
getTail()
Returns the last element in the list. |
int |
hashCode()
Computes a hash code value for the list. |
void |
insertAt(java.lang.Object element,
int index)
Inserts an element at the specified position in the list. |
void |
insertHead(java.lang.Object element)
Inserts an element at the beginning of the list. |
void |
insertTail(java.lang.Object element)
Inserts an element at the end of the list. |
boolean |
isEmpty()
Checks whether the list is empty. |
java.lang.Object |
removeFrom(int index)
Removes from the list the element at the specified location. |
java.lang.Object |
removeHead()
Removes the first element from the list. |
java.lang.Object |
removeTail()
Removes the last element from the list. |
java.lang.String |
toString()
Returns a string representation of the list. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected LinkedList.Node head
protected LinkedList.Node tail
protected int count
Constructor Detail |
public LinkedList()
Method Detail |
public boolean isEmpty()
isEmpty
in interface List
public int getCount()
getCount
in interface List
public java.lang.Object getHead()
getHead
in interface List
public java.lang.Object getTail()
getTail
in interface List
public java.lang.Object getFrom(int index)
getFrom
in interface List
index
- the index of the element to return.
public java.lang.String toString()
public boolean equals(java.lang.Object other)
other
- the object with which to compare.
public int hashCode()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
- if some element in the list
is not an instance of CloneableListElement.public void insertHead(java.lang.Object element)
insertHead
in interface List
element
- the element to be inserted.public void insertTail(java.lang.Object element)
insertTail
in interface List
element
- the element to be inserted.public void insertAt(java.lang.Object element, int index)
insertAt
in interface List
element
- the element to be inserted.index
- the position at which the element is to be inserted.public java.lang.Object removeHead()
removeHead
in interface List
public java.lang.Object removeTail()
removeTail
in interface List
public java.lang.Object removeFrom(int index)
removeFrom
in interface List
index
- the index of the element to be removed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |