public class ExposedNodeLinkedList extends Object implements List
LinkedNode
Constructor and Description |
---|
ExposedNodeLinkedList()
Constructs an empty list.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
Object object) |
boolean |
add(Object object) |
boolean |
addAll(Collection collection) |
boolean |
addAll(int index,
Collection collection) |
LinkedNode |
addFirst(Object o)
Inserts the given contents at the beginning of this list.
|
LinkedNode |
addLast(Object o)
Appends the given contents to the end of this list.
|
void |
clear()
Removes all of the contentss from this list.
|
boolean |
contains(Object o)
Returns true if this list contains the specified contents.
|
boolean |
containsAll(Collection collection) |
Object |
get(int index) |
Object |
getFirst()
Returns the first contents in this list.
|
Object |
getLast()
Returns the last contents in this list.
|
int |
indexOf(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() |
Iterator |
iterator() |
int |
lastIndexOf(Object object) |
ListIterator |
listIterator() |
ListIterator |
listIterator(int index) |
void |
moveFirst(LinkedNode node)
Allows a node to be efficiently moved first.
|
Object |
remove(int index) |
void |
remove(LinkedNode n)
Allows a node to be efficiently removed.
|
boolean |
remove(Object object) |
boolean |
removeAll(Collection collection) |
Object |
removeFirst()
Removes and returns the first contents from this list.
|
Object |
removeLast()
Removes and returns the last contents from this list.
|
boolean |
retainAll(Collection collection) |
Object |
set(int index,
Object value) |
int |
size()
Returns the number of contentss in this list.
|
List |
subList(int start,
int end) |
Object[] |
toArray() |
Object[] |
toArray(Object[] array) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, replaceAll, sort, spliterator
parallelStream, removeIf, stream
public Object[] toArray(Object[] array)
toArray
in interface Collection
toArray
in interface List
public Object[] toArray()
toArray
in interface Collection
toArray
in interface List
public ListIterator listIterator(int index)
listIterator
in interface List
public ListIterator listIterator()
listIterator
in interface List
public Iterator iterator()
public boolean retainAll(Collection collection)
retainAll
in interface Collection
retainAll
in interface List
public boolean removeAll(Collection collection)
removeAll
in interface Collection
removeAll
in interface List
public boolean containsAll(Collection collection)
containsAll
in interface Collection
containsAll
in interface List
public boolean addAll(Collection collection)
addAll
in interface Collection
addAll
in interface List
public boolean addAll(int index, Collection collection)
public boolean remove(Object object)
remove
in interface Collection
remove
in interface List
public boolean add(Object object)
add
in interface Collection
add
in interface List
public int lastIndexOf(Object object)
lastIndexOf
in interface List
public boolean isEmpty()
isEmpty
in interface Collection
isEmpty
in interface List
public Object getFirst()
public Object getLast()
public Object removeFirst()
NoSuchElementException
- if this list is empty.public Object removeLast()
NoSuchElementException
- if this list is empty.public LinkedNode addFirst(Object o)
o
- the contents to be inserted at the beginning of this list.public LinkedNode addLast(Object o)
o
- the contents to be inserted at the end of this list.public boolean contains(Object o)
contains
in interface Collection
contains
in interface List
o
- contents whose presence in this list is to be tested.public int size()
size
in interface Collection
size
in interface List
public void clear()
clear
in interface Collection
clear
in interface List
public int indexOf(Object o)
public void remove(LinkedNode n)
public void moveFirst(LinkedNode node)
Copyright © 2024. All rights reserved.