public abstract class NodeList<T extends Node> extends AbstractList<T> implements NodeIterable<T>, RandomAccess
| Modifier and Type | Class and Description |
|---|---|
static class |
NodeList.SubList<R extends Node> |
| Modifier and Type | Field and Description |
|---|---|
protected int |
initialSize |
protected Node[] |
nodes
The array that stores the contents of this node list.
|
protected Node |
self |
modCount| Modifier | Constructor and Description |
|---|---|
protected |
NodeList(Node self) |
protected |
NodeList(Node self,
int initialSize) |
protected |
NodeList(Node self,
List<? extends T> elements) |
protected |
NodeList(Node self,
T[] elements) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Node node)
Adds a new node to the list.
|
boolean |
addAll(Collection<? extends T> c) |
boolean |
addAll(T[] c) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
contains(T other) |
boolean |
containsAll(Collection<?> c) |
int |
count() |
boolean |
equals(Object other) |
T |
first() |
T |
get(int index)
Get a node from the list given an
index. |
abstract Edges.Type |
getEdgesType() |
protected void |
incModCount() |
int |
indexOf(Object node) |
void |
initialize(int index,
Node node) |
boolean |
isEmpty() |
boolean |
isNotEmpty() |
Iterator<T> |
iterator() |
T |
last() |
T |
remove(int index) |
boolean |
remove(Object node) |
protected void |
replace(T node,
T other) |
T |
set(int index,
Node node)
Set the node of the list at the given
index to a new value. |
int |
size() |
List<T> |
snapshot() |
void |
snapshotTo(Collection<? super T> to) |
Stream<T> |
stream() |
NodeList.SubList<T> |
subList(int startIndex) |
Object[] |
toArray() |
<A> A[] |
toArray(A[] a) |
String |
toString() |
void |
trim()
Removes
null values from the list. |
protected abstract void |
update(T oldNode,
T newNode) |
add, addAll, hashCode, lastIndexOf, listIterator, listIterator, removeRange, subListremoveAll, retainAllfilter, filterforEach, spliteratorcopyOf, of, of, of, of, of, of, of, of, of, of, of, of, removeAll, replaceAll, retainAll, sort, spliteratorparallelStream, removeIf, toArrayprotected final Node self
protected Node[] nodes
NodeList.size. The valid
indices into this array are those in the range 0..size-1 (inclusive). Elements at
indices size..nodes.length-1 can be overwritten, but they must never be read.protected final int initialSize
protected NodeList(Node self)
protected NodeList(Node self, int initialSize)
public void trim()
null values from the list.public abstract Edges.Type getEdgesType()
public final int size()
public final boolean isEmpty()
public boolean isNotEmpty()
isNotEmpty in interface NodeIterable<T extends Node>public int count()
count in interface NodeIterable<T extends Node>protected final void incModCount()
public boolean add(Node node)
NodeList.MAX_ENTRIES, otherwise a PermanentBailoutException is thrown.public T get(int index)
index.public T last()
public void initialize(int index,
Node node)
public boolean equals(Object other)
public Stream<T> stream()
stream in interface Collection<T extends Node>stream in interface NodeIterable<T extends Node>public void clear()
public boolean remove(Object node)
public T remove(int index)
public boolean contains(T other)
contains in interface NodeIterable<T extends Node>public void snapshotTo(Collection<? super T> to)
snapshotTo in interface NodeIterable<T extends Node>public <A> A[] toArray(A[] a)
public Object[] toArray()
public int indexOf(Object node)
public boolean contains(Object o)
public boolean containsAll(Collection<?> c)
containsAll in interface Collection<T extends Node>containsAll in interface List<T extends Node>containsAll in class AbstractCollection<T extends Node>public boolean addAll(Collection<? extends T> c)
public boolean addAll(T[] c)
public String toString()
toString in class AbstractCollection<T extends Node>public T first()
first in interface NodeIterable<T extends Node>public NodeList.SubList<T> subList(int startIndex)