public class SortedDoubleLinkedList<T> extends BasicDoubleLinkedList<T>
| Constructor and Description |
|---|
SortedDoubleLinkedList(java.util.Comparator<T> comparator)
Creates an empty list that is associated with the specified comparator.
|
| Modifier and Type | Method and Description |
|---|---|
SortedDoubleLinkedList<T> |
add(T element)
Inserts the specified element at the correct position in the sorted list.
|
BasicDoubleLinkedList<T> |
addToEnd(T data)
This operation is invalid for a sorted list.
|
BasicDoubleLinkedList<T> |
addToFront(T data)
This operation is invalid for a sorted list.
|
SortedDoubleLinkedList<T> |
merge(SortedDoubleLinkedList<T> list)
Merges two SortedLinkedLists.
|
SortedDoubleLinkedList<T> |
remove(T targetData)
Implements the remove operation by calling the super class remove method.
|
add, get, getFirst, getLast, getSize, iterator, remove, retrieve, retrieveFirstElement, retrieveLastElementpublic SortedDoubleLinkedList(java.util.Comparator<T> comparator)
comparator - public SortedDoubleLinkedList<T> add(T element)
element - public SortedDoubleLinkedList<T> merge(SortedDoubleLinkedList<T> list)
list - public SortedDoubleLinkedList<T> remove(T targetData)
targetData - public BasicDoubleLinkedList<T> addToEnd(T data)
addToEnd in class BasicDoubleLinkedList<T>data - java.lang.UnsupportedOperationExceptionpublic BasicDoubleLinkedList<T> addToFront(T data)
addToFront in class BasicDoubleLinkedList<T>data - java.lang.UnsupportedOperationException