N - the type of nodes contained.public class NodeList<N extends Node> extends Object implements List<N>, Iterable<N>, HasParentNode<NodeList<N>>, Visitable, Observable
| Modifier and Type | Method and Description |
|---|---|
<R,A> R |
accept(GenericVisitor<R,A> v,
A arg)
Accept method for visitor support.
|
<A> void |
accept(VoidVisitor<A> v,
A arg)
Accept method for visitor support.
|
void |
add(int index,
N node) |
boolean |
add(N node) |
boolean |
addAll(Collection<? extends N> c) |
boolean |
addAll(int index,
Collection<? extends N> c) |
void |
addAll(NodeList<N> otherList) |
void |
clear() |
boolean |
contains(N node) |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
equals(Object o) |
void |
forEach(Consumer<? super N> action) |
N |
get(int i) |
Optional<Node> |
getParentNode()
Return the parent node or null, if no parent is set.
|
Node |
getParentNodeForChildren()
this for everything except NodeLists.
|
int |
hashCode() |
int |
indexOf(Object o) |
boolean |
isEmpty() |
boolean |
isRegistered(AstObserver observer)
Was this observer registered?
Note that equals is used to determine if the given observer was registered.
|
Iterator<N> |
iterator() |
int |
lastIndexOf(Object o) |
ListIterator<N> |
listIterator() |
ListIterator<N> |
listIterator(int index) |
static <X extends Node> |
nodeList(Collection<X> nodes) |
static <X extends Node> |
nodeList(NodeList<X> nodes) |
static <X extends Node> |
nodeList(X... nodes) |
Stream<N> |
parallelStream() |
void |
register(AstObserver observer)
Register an observer.
|
N |
remove(int index) |
boolean |
remove(Node node) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
removeIf(Predicate<? super N> filter) |
void |
replaceAll(UnaryOperator<N> operator) |
boolean |
retainAll(Collection<?> c) |
N |
set(int index,
N element) |
NodeList<N> |
setParentNode(Node parentNode)
Sets the parentNode
|
int |
size() |
void |
sort(Comparator<? super N> comparator) |
Spliterator<N> |
spliterator() |
Stream<N> |
stream() |
List<N> |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
void |
unregister(AstObserver observer)
Unregister an observer.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetAncestorOfType, setAsParentNodeOf, setAsParentNodeOfpublic NodeList()
public NodeList(Node parent)
public boolean add(N node)
public boolean remove(Node node)
@SafeVarargs public static <X extends Node> NodeList<X> nodeList(X... nodes)
public static <X extends Node> NodeList<X> nodeList(Collection<X> nodes)
public boolean contains(N node)
public int size()
public boolean isEmpty()
public void sort(Comparator<? super N> comparator)
public Optional<Node> getParentNode()
HasParentNodegetParentNode in interface HasParentNode<NodeList<N extends Node>>public NodeList<N> setParentNode(Node parentNode)
setParentNode in interface HasParentNode<NodeList<N extends Node>>parentNode - the parentNodepublic Node getParentNodeForChildren()
HasParentNodegetParentNodeForChildren in interface HasParentNode<NodeList<N extends Node>>public <R,A> R accept(GenericVisitor<R,A> v, A arg)
Visitableaccept in interface VisitableR - the type of the return value of the visitorA - the type the user argument passed to the visitorv - the visitor implementationarg - the argument passed to the visitor (of type A)public <A> void accept(VoidVisitor<A> v, A arg)
Visitablepublic void forEach(Consumer<? super N> action)
forEach in interface Iterable<N extends Node>Iterable.forEach(java.util.function.Consumer)public boolean contains(Object o)
contains in interface Collection<N extends Node>contains in interface List<N extends Node>List.contains(java.lang.Object)public Object[] toArray()
toArray in interface Collection<N extends Node>toArray in interface List<N extends Node>List.toArray()public <T> T[] toArray(T[] a)
toArray in interface Collection<N extends Node>toArray in interface List<N extends Node>List.toArray(java.lang.Object[])public boolean remove(Object o)
remove in interface Collection<N extends Node>remove in interface List<N extends Node>List.remove(java.lang.Object)public boolean containsAll(Collection<?> c)
containsAll in interface Collection<N extends Node>containsAll in interface List<N extends Node>List.containsAll(java.util.Collection)public boolean addAll(Collection<? extends N> c)
addAll in interface Collection<N extends Node>addAll in interface List<N extends Node>List.addAll(java.util.Collection)public boolean addAll(int index,
Collection<? extends N> c)
addAll in interface List<N extends Node>List.addAll(int, java.util.Collection)public boolean removeAll(Collection<?> c)
removeAll in interface Collection<N extends Node>removeAll in interface List<N extends Node>List.removeAll(java.util.Collection)public boolean retainAll(Collection<?> c)
retainAll in interface Collection<N extends Node>retainAll in interface List<N extends Node>List.retainAll(java.util.Collection)public void replaceAll(UnaryOperator<N> operator)
replaceAll in interface List<N extends Node>List.replaceAll(java.util.function.UnaryOperator)public boolean removeIf(Predicate<? super N> filter)
removeIf in interface Collection<N extends Node>Collection.removeIf(java.util.function.Predicate)public void clear()
clear in interface Collection<N extends Node>clear in interface List<N extends Node>List.clear()public boolean equals(Object o)
public int hashCode()
public int indexOf(Object o)
indexOf in interface List<N extends Node>List.indexOf(java.lang.Object)public int lastIndexOf(Object o)
lastIndexOf in interface List<N extends Node>List.lastIndexOf(java.lang.Object)public ListIterator<N> listIterator()
listIterator in interface List<N extends Node>List.listIterator()public ListIterator<N> listIterator(int index)
listIterator in interface List<N extends Node>List.listIterator(int)public Stream<N> parallelStream()
parallelStream in interface Collection<N extends Node>Collection.parallelStream()public List<N> subList(int fromIndex, int toIndex)
subList in interface List<N extends Node>List.subList(int, int)public Spliterator<N> spliterator()
spliterator in interface Iterable<N extends Node>spliterator in interface Collection<N extends Node>spliterator in interface List<N extends Node>List.spliterator()public void unregister(AstObserver observer)
Observableunregister in interface Observablepublic void register(AstObserver observer)
Observableregister in interface Observablepublic boolean isRegistered(AstObserver observer)
ObservableisRegistered in interface ObservableCopyright © 2007–2017. All rights reserved.