|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object OrderedLinkedList<E>
public class OrderedLinkedList<E>
Constructor Summary | |
---|---|
OrderedLinkedList(java.util.Comparator<E> comparator)
Constructs an empty OrderedLinkedList whose order is specified by the provided Comparable. |
|
OrderedLinkedList(java.util.List<E> list,
java.util.Comparator<E> comparator)
Constructs an OrderedLinkedList containing the elements of the provided java.util.List in the order specified by the provided Comparator. |
Method Summary | |
---|---|
void |
add(E element)
Adds the element to the OrderedLinkedList in the position specified by the Comparator provided at construction. |
void |
clear()
Empties the OrderedLinkedList so that is contains no elements. |
java.util.ArrayList<E> |
get()
Builds and returns a java.util.ArrayList |
E |
get(int index)
Gets the specified element of the OrderedLinkedList |
int |
indexOf(E element)
Returns the index of the first element in the list that is equal to the element passed in using the element's equals method inherited from.Object to determine equality. |
ListIterator<E> |
listIterator()
Returns a ListIterator for this OrderedLinkedList. |
E |
remove(int index)
Removes and returns the element at the specified index. |
int |
size()
Returns the number of elements in the OrderedLinkedList. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OrderedLinkedList(java.util.Comparator<E> comparator)
public OrderedLinkedList(java.util.List<E> list, java.util.Comparator<E> comparator)
Method Detail |
---|
public void add(E element)
element
- The element to add to the OrderedLinkedList;public E get(int index)
index
- The index of the element to get.
java.lang.IndexOutOfBoundsException
- if the index if not valid.public java.util.ArrayList<E> get()
public int size()
public void clear()
public int indexOf(E element)
element
- The element to search for.
java.util.NoSuchElementException
- if the list does not contain the
specified element.public E remove(int index)
index
- The element to remove and return.
java.lang.IndexOutOfBoundsException
- if the index if not valid.public ListIterator<E> listIterator()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |