|
BRUtil - Making Java a Kinder, Gentler, Place to be. |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--brutil.LinkedList
SinglyLinkedList implementation - caters to the List interface.
| Constructor Summary | |
LinkedList()
|
|
| Method Summary | |
void |
append(java.lang.Object elt)
Appends given element to the end of the list. |
void |
clear()
Removes all elements from the list. |
java.lang.Object |
getFirst()
Returns the element at the beginning of the list. |
java.lang.Object |
getLast()
Returns the element at the end of the list. |
boolean |
isEmpty()
Returns true if there are no elements in the list
size == 0. |
ListIterator |
iterator()
Returns an ListIterator. |
void |
prepend(java.lang.Object elt)
Prepends given element to the beginning of the list. |
java.lang.Object |
removeFirst()
Removes and returns the first element in the list. |
java.lang.Object |
removeLast()
Removes last element in the list (optional operation). |
LinkedList |
reset()
|
ReverseListIterator |
reverseIterator()
Creates a ReverseListIterator (optional operation).] |
int |
size()
Returns the size of the List. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public LinkedList()
| Method Detail |
public LinkedList reset()
public void prepend(java.lang.Object elt)
prepend in interface Listelt - the element to be prepended.public void append(java.lang.Object elt)
append in interface Listelt - the element to be appended.public java.lang.Object getFirst()
getFirst in interface ListNoSuchElementException - if the list is empty.public java.lang.Object getLast()
getLast in interface ListNoSuchElementException - if the list is empty.public java.lang.Object removeFirst()
removeFirst in interface ListNoSuchElementException - if the list is empty.
public java.lang.Object removeLast()
throws java.lang.UnsupportedOperationException
removeLast in interface Listjava.lang.UnsupportedOperationException - public int size()
size in interface Listpublic boolean isEmpty()
true if there are no elements in the list
size == 0.isEmpty in interface Listtrue if there are no elements in the list
size == 0.public void clear()
clear in interface Listpublic ListIterator iterator()
ListIterator.iterator in interface List
public ReverseListIterator reverseIterator()
throws java.lang.UnsupportedOperationException
reverseIterator in interface ListUnsupportedMethodException - public java.lang.String toString()
toString in class java.lang.Object
|
BRUtil - Making Java a Kinder, Gentler, Place to be. |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||