public class ExposedNodeLinkedList
extends java.lang.Object
implements java.util.List
LinkedNode| Constructor and Description |
|---|
ExposedNodeLinkedList()
Constructs an empty list.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
java.lang.Object object) |
boolean |
add(java.lang.Object object) |
boolean |
addAll(java.util.Collection collection) |
boolean |
addAll(int index,
java.util.Collection collection) |
LinkedNode |
addFirst(java.lang.Object o)
Inserts the given contents at the beginning of this list.
|
LinkedNode |
addLast(java.lang.Object o)
Appends the given contents to the end of this list.
|
void |
clear()
Removes all of the contentss from this list.
|
boolean |
contains(java.lang.Object o)
Returns true if this list contains the specified contents.
|
boolean |
containsAll(java.util.Collection collection) |
java.lang.Object |
get(int index) |
java.lang.Object |
getFirst()
Returns the first contents in this list.
|
java.lang.Object |
getLast()
Returns the last contents in this list.
|
int |
indexOf(java.lang.Object o)
Returns the index in this list of the first occurrence of the
specified contents, or -1 if the List does not contain this
contents.
|
boolean |
isEmpty() |
java.util.Iterator |
iterator() |
int |
lastIndexOf(java.lang.Object object) |
java.util.ListIterator |
listIterator() |
java.util.ListIterator |
listIterator(int index) |
void |
moveFirst(LinkedNode node)
Allows a node to be efficiently moved first.
|
java.lang.Object |
remove(int index) |
void |
remove(LinkedNode n)
Allows a node to be efficiently removed.
|
boolean |
remove(java.lang.Object object) |
boolean |
removeAll(java.util.Collection collection) |
java.lang.Object |
removeFirst()
Removes and returns the first contents from this list.
|
java.lang.Object |
removeLast()
Removes and returns the last contents from this list.
|
boolean |
retainAll(java.util.Collection collection) |
java.lang.Object |
set(int index,
java.lang.Object value) |
int |
size()
Returns the number of contentss in this list.
|
java.util.List |
subList(int start,
int end) |
java.lang.Object[] |
toArray() |
java.lang.Object[] |
toArray(java.lang.Object[] array) |
public java.lang.Object[] toArray(java.lang.Object[] array)
toArray in interface java.util.CollectiontoArray in interface java.util.Listpublic java.lang.Object[] toArray()
toArray in interface java.util.CollectiontoArray in interface java.util.Listpublic java.lang.Object set(int index,
java.lang.Object value)
set in interface java.util.Listpublic java.util.ListIterator listIterator(int index)
listIterator in interface java.util.Listpublic java.util.ListIterator listIterator()
listIterator in interface java.util.Listpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Listpublic java.util.List subList(int start,
int end)
subList in interface java.util.Listpublic boolean retainAll(java.util.Collection collection)
retainAll in interface java.util.CollectionretainAll in interface java.util.Listpublic boolean removeAll(java.util.Collection collection)
removeAll in interface java.util.CollectionremoveAll in interface java.util.Listpublic boolean containsAll(java.util.Collection collection)
containsAll in interface java.util.CollectioncontainsAll in interface java.util.Listpublic boolean addAll(java.util.Collection collection)
addAll in interface java.util.CollectionaddAll in interface java.util.Listpublic boolean addAll(int index,
java.util.Collection collection)
addAll in interface java.util.Listpublic boolean remove(java.lang.Object object)
remove in interface java.util.Collectionremove in interface java.util.Listpublic boolean add(java.lang.Object object)
add in interface java.util.Collectionadd in interface java.util.Listpublic int lastIndexOf(java.lang.Object object)
lastIndexOf in interface java.util.Listpublic void add(int index,
java.lang.Object object)
add in interface java.util.Listpublic java.lang.Object remove(int index)
remove in interface java.util.Listpublic java.lang.Object get(int index)
get in interface java.util.Listpublic boolean isEmpty()
isEmpty in interface java.util.CollectionisEmpty in interface java.util.Listpublic java.lang.Object getFirst()
public java.lang.Object getLast()
public java.lang.Object removeFirst()
java.util.NoSuchElementException - if this list is empty.public java.lang.Object removeLast()
java.util.NoSuchElementException - if this list is empty.public LinkedNode addFirst(java.lang.Object o)
o - the contents to be inserted at the beginning of this list.public LinkedNode addLast(java.lang.Object o)
o - the contents to be inserted at the end of this list.public boolean contains(java.lang.Object o)
contains in interface java.util.Collectioncontains in interface java.util.Listo - contents whose presence in this list is to be tested.public int size()
size in interface java.util.Collectionsize in interface java.util.Listpublic void clear()
clear in interface java.util.Collectionclear in interface java.util.Listpublic int indexOf(java.lang.Object o)
indexOf in interface java.util.Listo - contents to search for.public void remove(LinkedNode n)
public void moveFirst(LinkedNode node)