public class LinkedListImpl<E> extends Object implements LinkedList<E>
This class is not thread safe.
| Modifier and Type | Class and Description |
|---|---|
static class |
LinkedListImpl.Node<T> |
| Constructor and Description |
|---|
LinkedListImpl() |
LinkedListImpl(Comparator<E> comparator) |
LinkedListImpl(Comparator<E> comparator,
ToLongFunction<E> supplier) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHead(E e) |
void |
addSorted(E e) |
void |
addTail(E e) |
void |
clear() |
void |
clearID() |
int |
getSizeOfSuppliedIDs()
Return the number of elements we have on suppliedIDs
|
LinkedListIterator<E> |
iterator() |
int |
numIters() |
E |
poll() |
E |
removeWithID(long id) |
void |
setIDSupplier(ToLongFunction<E> supplier)
The ID Supplier function needs to return positive IDs (greater or equal to 0)
If you spply a negative ID, it will be considered a null value, and
the value will just be ignored.
|
int |
size() |
String |
toString() |
public LinkedListImpl()
public LinkedListImpl(Comparator<E> comparator)
public LinkedListImpl(Comparator<E> comparator, ToLongFunction<E> supplier)
public void clearID()
clearID in interface LinkedList<E>public void setIDSupplier(ToLongFunction<E> supplier)
LinkedListsetIDSupplier in interface LinkedList<E>public void addHead(E e)
addHead in interface LinkedList<E>public E removeWithID(long id)
removeWithID in interface LinkedList<E>public void addTail(E e)
addTail in interface LinkedList<E>public void addSorted(E e)
public E poll()
poll in interface LinkedList<E>public void clear()
clear in interface LinkedList<E>public int size()
size in interface LinkedList<E>public int getSizeOfSuppliedIDs()
public LinkedListIterator<E> iterator()
iterator in interface LinkedList<E>public int numIters()
Copyright © 2021 The Apache Software Foundation. All rights reserved.