NodeList

A list of nodes. It usually has a parent node. Unlike normal Nodes, this does not mean that it is a child of that parent. Instead, this list will make every node it contains a child of its parent. This way, a NodeList does not create an extra level inside the AST.

Parameters

<N>

the type of nodes contained.

Constructors

Link copied to clipboard
constructor()
constructor(n: Collection<N>)
constructor(n: Array<N>)

Functions

Link copied to clipboard
open fun <R, A> accept(v: GenericVisitor<R, A>, arg: A): R
open fun <A> accept(v: VoidVisitor<A>, arg: A)
Accept method for visitor support.
Link copied to clipboard
open fun add(node: N): Boolean
open fun add(index: Int, node: N)
Link copied to clipboard
open fun addAfter(node: N, afterThisNode: N): NodeList<N>
Inserts the node after afterThisNode.
Link copied to clipboard
open fun addAll(otherList: NodeList<N>)
open fun addAll(c: Collection<out N>): Boolean
open fun addAll(index: Int, c: Collection<out N>): Boolean
Link copied to clipboard
open fun addBefore(node: N, beforeThisNode: N): NodeList<N>
Inserts the node before beforeThisNode.
Link copied to clipboard
open fun addFirst(e: E)
Link copied to clipboard
open fun addLast(e: E)
Link copied to clipboard
open fun addNFirst(node: N): NodeList<N>
Inserts the node before all other nodes.
Link copied to clipboard
open fun addNLast(node: N): NodeList<N>
Inserts the node after all other nodes.
Link copied to clipboard
open fun clear()
Link copied to clipboard
open fun contains(node: N): Boolean
open fun contains(o: Any): Boolean
Link copied to clipboard
open fun containsAll(c: Collection<out Any>): Boolean
Link copied to clipboard
open fun <E> copyOf(coll: Collection<out E>): List<E>
Link copied to clipboard
open fun equals(o: Any): Boolean
Link copied to clipboard
open fun <N> findAncestor(types: Array<Class<N>>): Optional<N>
Walks the parents of this node and returns the first node of type type, or empty() if none is found.
open fun <N> findAncestor(type: Class<N>, predicate: Predicate<N>): Optional<N>
Walks the parents of this node and returns the first node of type type that matches predicate, or empty() if none is found.
open fun <N> findAncestor(predicate: Predicate<N>, types: Array<Class<N>>): Optional<N>
Walks the parents of this node and returns the first node that matches one of types types, or empty() if none is found.
Link copied to clipboard
open fun forEach(action: Consumer<in N>)
Link copied to clipboard
open fun get(i: Int): N
Link copied to clipboard
open fun getFirst(): E
Link copied to clipboard
open fun getLast(): E
Link copied to clipboard
open fun getOFirst(): Optional<N>
Link copied to clipboard
open fun getOLast(): Optional<N>
Link copied to clipboard
Returns the parent node, or Optional.empty if no parent is set.
Link copied to clipboard
Returns the parent node from the perspective of the children of this node.
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
Returns true if the parent has a parent
Link copied to clipboard
open fun ifNonEmpty(consumer: Consumer<in NodeList<N>>)
Link copied to clipboard
open fun indexOf(o: Any): Int
Link copied to clipboard
open fun isDescendantOf(ancestor: Node): Boolean
Determines whether this HasParentNode node is a descendant of the given node.
Link copied to clipboard
open fun isEmpty(): Boolean
Link copied to clipboard
open fun isNonEmpty(): Boolean
Link copied to clipboard
open fun isRegistered(observer: AstObserver): Boolean
Was this observer registered?
Link copied to clipboard
open fun iterator(): Iterator<N>
Link copied to clipboard
open fun lastIndexOf(o: Any): Int
Link copied to clipboard
open fun listIterator(index: Int): ListIterator<N>
Link copied to clipboard
open fun <X : Node?> nodeList(nodes: Array<X>): NodeList<X>
open fun <X : Node?> nodeList(nodes: NodeList<X>): NodeList<X>
open fun <X : Node?> nodeList(nodes: Collection<X>): NodeList<X>
Link copied to clipboard
open fun <E> of(): List<E>
Link copied to clipboard
open fun parallelStream(): Stream<N>
Link copied to clipboard
open fun register(observer: AstObserver)
Register an observer.
Link copied to clipboard
open fun remove(node: Node): Boolean
open fun remove(index: Int): N
open fun remove(o: Any): Boolean
Link copied to clipboard
open fun removeAll(c: Collection<out Any>): Boolean
Link copied to clipboard
open fun removeFirst(): N
Link copied to clipboard
open fun removeIf(filter: Predicate<in N>): Boolean
Link copied to clipboard
open fun removeLast(): N
Link copied to clipboard
open fun replace(old: N, replacement: N): Boolean
Replaces the first node that is equal to "old" with "replacement".
Link copied to clipboard
open fun replaceAll(operator: UnaryOperator<N>)
Link copied to clipboard
open fun retainAll(c: Collection<out Any>): Boolean
Link copied to clipboard
open fun reversed(): List<E>
abstract fun reversed(): SequencedCollection<E>
Link copied to clipboard
open fun set(index: Int, element: N): N
Link copied to clipboard
open fun setParentNode(parentNode: Node): NodeList<N>
Sets the parentNode
Link copied to clipboard
open fun size(): Int
Link copied to clipboard
open fun sort(comparator: Comparator<in N>)
Link copied to clipboard
Link copied to clipboard
open fun stream(): Stream<E>
Link copied to clipboard
open fun subList(fromIndex: Int, toIndex: Int): List<N>
Link copied to clipboard
open fun toArray(): Array<Any>
open fun <T> toArray(a: Array<T>): Array<T>
Link copied to clipboard
open fun <T : Node?> toNodeList(): Collector<T, NodeList<T>, NodeList<T>>
Link copied to clipboard
open fun toString(): String
Link copied to clipboard
open fun unregister(observer: AstObserver)
Unregister an observer.