Class ListNode

java.lang.Object
uk.blankaspect.common.basictree.AbstractNode
uk.blankaspect.common.basictree.ListNode
All Implemented Interfaces:
Cloneable, Iterable<AbstractNode>, ITreeNode<AbstractNode>

public class ListNode extends AbstractNode implements Iterable<AbstractNode>
This class implements a node that contains a sequence of elements that are nodes. The elements may be of different types (eg, a mixture of string nodes and list nodes).

A list node may be created with an initial collection of elements, and elements may be added to a list node after its creation, but elements cannot be removed from a list node.

The default string representation of a list node begins with a '[' (U+005B) and ends with a ']' (U+005D). Adjacent elements are separated with a ',' (U+002C).

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final char
    The character that separates adjacent elements in the string representation of a list node.
    static final char
    The character that denotes the end of the string representation of a list node.
    static final char
    The character that denotes the start of the string representation of a list node.
    static final NodeType
    The type of a list node.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance of a list node that has no parent and initially contains no elements.
    ListNode(Iterable<? extends AbstractNode> elements)
    Creates a new instance of a list node that has no parent and initially contains the specified elements.
    Creates a new instance of a list node that has the specified parent and initially contains no elements.
    ListNode(AbstractNode parent, Iterable<? extends AbstractNode> elements)
    Creates a new instance of a list node that has the specified parent and initially contains the specified elements.
    ListNode(AbstractNode parent, AbstractNode... elements)
    Creates a new instance of a list node that has the specified parent and initially contains the specified elements.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds the specified node to the end of the list of elements of this list node.
    addBoolean(boolean value)
    Creates a new instance of a Boolean node with the specified value, adds it to the end of of the list of elements of this list node and returns it.
    void
    addBooleans(boolean... values)
    Creates new instances of Boolean nodes with the specified values and adds them to the end of the list of elements of this list node, preserving the order of the values.
    void
    Creates new instances of Boolean nodes with the specified values and adds them to the end of the list of elements of this list node, preserving the order of the values.
    addDouble(double value)
    Creates a new instance of a 'double' node with the specified value, adds it to the end of the list of elements of this list node and returns it.
    void
    addDoubles(double... values)
    Creates new instances of 'double' nodes with the specified values and adds them to the end of the list of elements of this list node, preserving the order of the values.
    void
    Creates new instances of 'double' nodes with the specified values and adds them to the end of the list of elements of this list node, preserving the order of the values.
    void
    addElements(Iterable<? extends AbstractNode> nodes)
    Adds the specified nodes to the end of the list of elements of this list node.
    void
    Adds the specified nodes to the end of the list of elements of this list node.
    addInt(int value)
    Creates a new instance of an 'int' node with the specified value, adds it to the end of the list of elements of this list node and returns it.
    void
    addInts(int... values)
    Creates new instances of 'int' nodes with the specified values and adds them to the end of the list of elements of this list node, preserving the order of the values.
    void
    Creates new instances of 'int' nodes with the specified values and adds them to the end of the list of elements of this list node, preserving the order of the values.
    addList(Iterable<? extends AbstractNode> elements)
    Creates a new instance of a list node with the specified elements, adds it to the end of the list of elements of this list node and returns it.
    addList(AbstractNode... elements)
    Creates a new instance of a list node with the specified elements, adds it to the end of the list of elements of this list node and returns it.
    addLong(long value)
    Creates a new instance of a 'long' node with the specified value, adds it to the end of the list of elements of this list node and returns it.
    void
    addLongs(long... values)
    Creates new instances of 'long' nodes with the specified values and adds them to the end of the list of elements of this list node, preserving the order of the values.
    void
    Creates new instances of 'long' nodes with the specified values and adds them to the end of the list of elements of this list node, preserving the order of the values.
    Creates a new instance of a map node with the specified key–value pairs, adds it to the end of the list of elements of this list node and returns it.
    Creates a new instance of a null node and adds it to the end of the list of elements of this list node.
    Creates a new instance of a string node with the specified value, adds it to the end of the list of elements of this list node and returns it.
    void
    Creates new instances of string nodes with the specified values and adds them to the end of the list of elements of this list node, preserving the order of the values.
    void
    addStrings(String... values)
    Creates new instances of string nodes with the specified values and adds them to the end of the list of elements of this list node, preserving the order of the values.
    Returns a list of the elements of this list node that are Boolean nodes.
    Returns a stream of the elements of this list node that are Boolean nodes.
    void
    Removes all the elements of this list node.
    Creates and returns a deep copy of this list node that has no parent.
    Returns a list of the elements of this list node that are 'double' nodes.
    Returns a stream of the elements of this list node that are 'double' nodes.
    boolean
    Returns true if the specified object is an instance of ListNode and this list node contains the same number of elements as the other list node and each element in this list node is equal to the element at the same index in the other list node.
    get(int index)
    Returns the element of this list node at the specified index.
    getBoolean(int index)
    Returns the element of this list node at the specified index as a Boolean node.
    boolean[]
    Returns the underlying values of the elements of this list node as an array of booleans.
    Returns the underlying values of the elements of this list node as a list of Booleans.
    Returns a list of the elements of this list node.
    getDouble(int index)
    Returns the element of this list node at the specified index as a 'double' node.
    double[]
    Returns the underlying values of the elements of this list node as an array of doubles.
    Returns the underlying values of the elements of this list node as a list of Doubles.
    Returns an unmodifiable list of the elements of this list node.
    getInt(int index)
    Returns the element of this list node at the specified index as an 'int' node.
    int[]
    Returns the underlying values of the elements of this list node as an array of ints.
    Returns the underlying values of the elements of this list node as a list of Integers.
    long[]
    Returns the underlying values of the elements of this list node as an array of longs.
    Returns the underlying values of the elements of this list node as a list of Longs.
    getList(int index)
    Returns the element of this list node at the specified index as a list node.
    getLong(int index)
    Returns the element of this list node at the specified index as a 'long' node.
    long[]
    Returns the underlying values of the elements of this list node as an array of longs.
    Returns the underlying values of the elements of this list node as a list of Longs.
    getMap(int index)
    Returns the element of this list node at the specified index as a map node.
    getNull(int index)
    Returns the element of this list node at the specified index as a null node.
    int
    Returns the number of elements that this list node contains.
    getString(int index)
    Returns the element of this list node at the specified index as a string node.
    Returns the underlying values of the elements of this list node as an array of strings.
    Returns the underlying values of the elements of this list node as a list of strings.
    Returns the type of this node.
    int
    Returns the hash code of this list node, which is the hash code of its elements.
    int
    Returns the index of the specified node in the list of the elements of this list node.
    Returns a list of the elements of this list node that are 'int' nodes.
    Returns a stream of the elements of this list node that are 'int' nodes.
    boolean
    Returns true if this node can contain other nodes.
    boolean
    Returns true if this list node contains no elements.
    Returns an iterator over the elements of this list node.
    Returns a list of the elements of this list node that are list nodes.
    Returns a stream of the elements of this list node that are list nodes.
    Returns a list of the elements of this list node that are 'long' nodes.
    Returns a stream of the elements of this list node that are 'long' nodes.
    Returns a list of the elements of this list node that are map nodes.
    Returns a stream of the elements of this list node that are map nodes.
    void
    setElements(Iterable<? extends AbstractNode> nodes)
    Sets the elements of this list node to the specified nodes.
    void
    Sets the elements of this list node to the specified nodes.
    Returns a list of the elements of this list node that are string nodes.
    Returns a stream of the elements of this list node that are string nodes.
    Returns a string representation of this list node.

    Methods inherited from class uk.blankaspect.common.basictree.AbstractNode

    getListIndex, getMapKey, getParent, isRoot, setParent

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator

    Methods inherited from interface uk.blankaspect.common.tree.ITreeNode

    isLeaf
  • Field Details

    • START_CHAR

      public static final char START_CHAR
      The character that denotes the start of the string representation of a list node.
      See Also:
    • END_CHAR

      public static final char END_CHAR
      The character that denotes the end of the string representation of a list node.
      See Also:
    • ELEMENT_SEPARATOR_CHAR

      public static final char ELEMENT_SEPARATOR_CHAR
      The character that separates adjacent elements in the string representation of a list node.
      See Also:
    • TYPE

      public static final NodeType TYPE
      The type of a list node.
  • Constructor Details

    • ListNode

      public ListNode()
      Creates a new instance of a list node that has no parent and initially contains no elements.
    • ListNode

      public ListNode(AbstractNode parent)
      Creates a new instance of a list node that has the specified parent and initially contains no elements.
      Parameters:
      parent - the parent of the list node.
    • ListNode

      public ListNode(Iterable<? extends AbstractNode> elements)
      Creates a new instance of a list node that has no parent and initially contains the specified elements.
      Parameters:
      elements - the initial elements of the list node.
    • ListNode

      public ListNode(AbstractNode parent, AbstractNode... elements)
      Creates a new instance of a list node that has the specified parent and initially contains the specified elements.
      Parameters:
      parent - the parent of the list node.
      elements - the initial elements of the list node.
    • ListNode

      public ListNode(AbstractNode parent, Iterable<? extends AbstractNode> elements)
      Creates a new instance of a list node that has the specified parent and initially contains the specified elements.
      Parameters:
      parent - the parent of the list node.
      elements - the initial elements of the list node.
  • Method Details

    • getType

      public NodeType getType()
      Description copied from class: AbstractNode
      Returns the type of this node.
      Specified by:
      getType in class AbstractNode
      Returns:
      TYPE.
    • isContainer

      public boolean isContainer()
      Returns true if this node can contain other nodes. For a list node, this method always returns true.
      Specified by:
      isContainer in class AbstractNode
      Returns:
      true.
    • getChildren

      public List<AbstractNode> getChildren()
      Returns a list of the elements of this list node. The returned list may be modified without affecting this list node, but modifying the elements of the list (for example, changing the parent of a node) will affect this list node.
      Specified by:
      getChildren in interface ITreeNode<AbstractNode>
      Overrides:
      getChildren in class AbstractNode
      Returns:
      a list of the elements of this list node.
      See Also:
    • iterator

      public Iterator<AbstractNode> iterator()
      Returns an iterator over the elements of this list node.
      Specified by:
      iterator in interface Iterable<AbstractNode>
      Returns:
      an iterator over the elements of this list node.
    • equals

      public boolean equals(Object obj)
      Returns true if the specified object is an instance of ListNode and this list node contains the same number of elements as the other list node and each element in this list node is equal to the element at the same index in the other list node.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object with which this list node will be compared.
      Returns:
      true if obj is an instance of ListNode and this list node contains the same number of elements as the other list node and each element in this list node is equal to the element at the same index in the other list node; false otherwise.
    • hashCode

      public int hashCode()
      Returns the hash code of this list node, which is the hash code of its elements.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code of this list node.
    • clone

      public ListNode clone()
      Creates and returns a deep copy of this list node that has no parent.
      Overrides:
      clone in class AbstractNode
      Returns:
      a deep copy of this list node that has no parent.
    • toString

      public String toString()
      Returns a string representation of this list node.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this list node.
    • isEmpty

      public boolean isEmpty()
      Returns true if this list node contains no elements.
      Returns:
      true if this list node contains no elements; false otherwise.
    • getNumElements

      public int getNumElements()
      Returns the number of elements that this list node contains.
      Returns:
      the number of elements that this list node contains.
    • get

      public AbstractNode get(int index)
      Returns the element of this list node at the specified index.
      Parameters:
      index - the index of the required element.
      Returns:
      the element of this list node at index.
      Throws:
      IndexOutOfBoundsException - if (index < 0) or (index >= getNumElements()).
    • getNull

      public NullNode getNull(int index)
      Returns the element of this list node at the specified index as a null node.
      Parameters:
      index - the index of the required element.
      Returns:
      the element of this list node at index, cast to a NullNode.
      Throws:
      IndexOutOfBoundsException - if (index < 0) or (index >= getNumElements()).
      ClassCastException - if the element at index is not an instance of NullNode.
    • getBoolean

      public BooleanNode getBoolean(int index)
      Returns the element of this list node at the specified index as a Boolean node.
      Parameters:
      index - the index of the required element.
      Returns:
      the element of this list node at index, cast to a BooleanNode.
      Throws:
      IndexOutOfBoundsException - if (index < 0) or (index >= getNumElements()).
      ClassCastException - if the element at index is not an instance of BooleanNode.
    • getInt

      public IntNode getInt(int index)
      Returns the element of this list node at the specified index as an 'int' node.
      Parameters:
      index - the index of the required element.
      Returns:
      the element of this list node at index, cast to a IntNode.
      Throws:
      IndexOutOfBoundsException - if (index < 0) or (index >= getNumElements()).
      ClassCastException - if the element at index is not an instance of IntNode.
    • getLong

      public LongNode getLong(int index)
      Returns the element of this list node at the specified index as a 'long' node.
      Parameters:
      index - the index of the required element.
      Returns:
      the element of this list node at index, cast to a LongNode.
      Throws:
      IndexOutOfBoundsException - if (index < 0) or (index >= getNumElements()).
      ClassCastException - if the element at index is not an instance of LongNode.
    • getDouble

      public DoubleNode getDouble(int index)
      Returns the element of this list node at the specified index as a 'double' node.
      Parameters:
      index - the index of the required element.
      Returns:
      the element of this list node at index, cast to a DoubleNode.
      Throws:
      IndexOutOfBoundsException - if (index < 0) or (index >= getNumElements()).
      ClassCastException - if the element at index is not an instance of DoubleNode.
    • getString

      public StringNode getString(int index)
      Returns the element of this list node at the specified index as a string node.
      Parameters:
      index - the index of the required element.
      Returns:
      the element of this list node at index, cast to a StringNode.
      Throws:
      IndexOutOfBoundsException - if (index < 0) or (index >= getNumElements()).
      ClassCastException - if the element at index is not an instance of StringNode.
    • getList

      public ListNode getList(int index)
      Returns the element of this list node at the specified index as a list node.
      Parameters:
      index - the index of the required element.
      Returns:
      the element of this list node at index, cast to a ListNode.
      Throws:
      IndexOutOfBoundsException - if (index < 0) or (index >= getNumElements()).
      ClassCastException - if the element at index is not an instance of ListNode.
    • getMap

      public MapNode getMap(int index)
      Returns the element of this list node at the specified index as a map node.
      Parameters:
      index - the index of the required element.
      Returns:
      the element of this list node at index, cast to a MapNode.
      Throws:
      IndexOutOfBoundsException - if (index < 0) or (index >= getNumElements()).
      ClassCastException - if the element at index is not an instance of MapNode.
    • getElements

      public List<AbstractNode> getElements()
      Returns an unmodifiable list of the elements of this list node. Although the returned list cannot be modified, its elements can be modified, and doing so (for example, changing the parent of a node) will affect this list node.
      Returns:
      an unmodifiable list of the elements of this list node.
      See Also:
    • booleanNodes

      public List<BooleanNode> booleanNodes()
      Returns a list of the elements of this list node that are Boolean nodes.
      Returns:
      a list of the elements of this list node that are Boolean nodes.
    • booleanStream

      public Stream<BooleanNode> booleanStream()
      Returns a stream of the elements of this list node that are Boolean nodes.
      Returns:
      a stream of the elements of this list node that are Boolean nodes.
    • getBooleanArray

      public boolean[] getBooleanArray()
      Returns the underlying values of the elements of this list node as an array of booleans.
      Returns:
      an array of the underlying boolean values of the elements of this list node.
      Throws:
      NodeTypeException - if any of the elements of this list node is not a Boolean node.
    • getBooleanList

      public List<Boolean> getBooleanList()
      Returns the underlying values of the elements of this list node as a list of Booleans.
      Returns:
      a list of the underlying Boolean values of the elements of this list node.
      Throws:
      NodeTypeException - if any of the elements of this list node is not a Boolean node.
    • intNodes

      public List<IntNode> intNodes()
      Returns a list of the elements of this list node that are 'int' nodes.
      Returns:
      a list of the elements of this list node that are 'int' nodes.
    • intStream

      public Stream<IntNode> intStream()
      Returns a stream of the elements of this list node that are 'int' nodes.
      Returns:
      a stream of the elements of this list node that are 'int' nodes.
    • getIntArray

      public int[] getIntArray()
      Returns the underlying values of the elements of this list node as an array of ints.
      Returns:
      an array of the underlying int values of the elements of this list node.
      Throws:
      NodeTypeException - if any of the elements of this list node is not an 'int' node.
    • getIntList

      public List<Integer> getIntList()
      Returns the underlying values of the elements of this list node as a list of Integers.
      Returns:
      a list of the underlying Integer values of the elements of this list node.
      Throws:
      NodeTypeException - if any of the elements of this list node is not an 'int' node.
    • longNodes

      public List<LongNode> longNodes()
      Returns a list of the elements of this list node that are 'long' nodes.
      Returns:
      a list of the elements of this list node that are 'long' nodes.
    • longStream

      public Stream<LongNode> longStream()
      Returns a stream of the elements of this list node that are 'long' nodes.
      Returns:
      a stream of the elements of this list node that are 'long' nodes.
    • getLongArray

      public long[] getLongArray()
      Returns the underlying values of the elements of this list node as an array of longs.
      Returns:
      an array of the underlying long values of the elements of this list node.
      Throws:
      NodeTypeException - if any of the elements of this list node is not a 'long' node.
    • getLongList

      public List<Long> getLongList()
      Returns the underlying values of the elements of this list node as a list of Longs.
      Returns:
      a list of the underlying Long values of the elements of this list node.
      Throws:
      NodeTypeException - if any of the elements of this list node is not a 'long' node.
    • getIntOrLongArray

      public long[] getIntOrLongArray()
      Returns the underlying values of the elements of this list node as an array of longs. The elements of this list may be either 'int' nodes or 'long' nodes.
      Returns:
      an array of the underlying long values of the elements of this list node.
      Throws:
      NodeTypeException - if any of the elements of this list node is neither an 'int' node nor a 'long' node.
    • getIntOrLongList

      public List<Long> getIntOrLongList()
      Returns the underlying values of the elements of this list node as a list of Longs. The elements of this list may be either 'int' nodes or 'long' nodes.
      Returns:
      a list of the underlying Long values of the elements of this list node.
      Throws:
      NodeTypeException - if any of the elements of this list node is neither an 'int' node nor a 'long' node.
    • doubleNodes

      public List<DoubleNode> doubleNodes()
      Returns a list of the elements of this list node that are 'double' nodes.
      Returns:
      a list of the elements of this list node that are 'double' nodes.
    • doubleStream

      public Stream<DoubleNode> doubleStream()
      Returns a stream of the elements of this list node that are 'double' nodes.
      Returns:
      a stream of the elements of this list node that are 'double' nodes.
    • getDoubleArray

      public double[] getDoubleArray()
      Returns the underlying values of the elements of this list node as an array of doubles.
      Returns:
      an array of the underlying double values of the elements of this list node.
      Throws:
      NodeTypeException - if any of the elements of this list node is not a 'double' node.
    • getDoubleList

      public List<Double> getDoubleList()
      Returns the underlying values of the elements of this list node as a list of Doubles.
      Returns:
      a list of the underlying Double values of the elements of this list node.
      Throws:
      NodeTypeException - if any of the elements of this list node is not a 'double' node.
    • stringNodes

      public List<StringNode> stringNodes()
      Returns a list of the elements of this list node that are string nodes.
      Returns:
      a list of the elements of this list node that are string nodes.
    • stringStream

      public Stream<StringNode> stringStream()
      Returns a stream of the elements of this list node that are string nodes.
      Returns:
      a stream of the elements of this list node that are string nodes.
    • getStringArray

      public String[] getStringArray()
      Returns the underlying values of the elements of this list node as an array of strings.
      Returns:
      an array of the underlying string values of the elements of this list node.
      Throws:
      NodeTypeException - if any of the elements of this list node is not a string node.
    • getStringList

      public List<String> getStringList()
      Returns the underlying values of the elements of this list node as a list of strings.
      Returns:
      a list of the underlying string values of the elements of this list node.
      Throws:
      NodeTypeException - if any of the elements of this list node is not a string node.
    • listNodes

      public List<ListNode> listNodes()
      Returns a list of the elements of this list node that are list nodes.
      Returns:
      a list of the elements of this list node that are list nodes.
    • listStream

      public Stream<ListNode> listStream()
      Returns a stream of the elements of this list node that are list nodes.
      Returns:
      a stream of the elements of this list node that are list nodes.
    • mapNodes

      public List<MapNode> mapNodes()
      Returns a list of the elements of this list node that are map nodes.
      Returns:
      a list of the elements of this list node that are map nodes.
    • mapStream

      public Stream<MapNode> mapStream()
      Returns a stream of the elements of this list node that are map nodes.
      Returns:
      a stream of the elements of this list node that are map nodes.
    • indexOf

      public int indexOf(AbstractNode node)
      Returns the index of the specified node in the list of the elements of this list node. The node is compared for identity, not equality, with each element of the list until a match is found or all elements have been compared.
      Parameters:
      node - the node whose index is required.
      Returns:
      the index of node in the list of the elements of this list node, or -1 if node is not an element of this list node.
    • clear

      public void clear()
      Removes all the elements of this list node.
    • setElements

      public void setElements(AbstractNode... nodes)
      Sets the elements of this list node to the specified nodes.
      Parameters:
      nodes - the nodes to which the elements of this list node will be set.
    • setElements

      public void setElements(Iterable<? extends AbstractNode> nodes)
      Sets the elements of this list node to the specified nodes.
      Parameters:
      nodes - the nodes to which the elements of this list node will be set.
    • add

      public void add(AbstractNode node)
      Adds the specified node to the end of the list of elements of this list node.
      Parameters:
      node - the node that will be added to the end of the list of elements of this list node.
      Throws:
      IllegalArgumentException - if node is null.
    • addElements

      public void addElements(AbstractNode... nodes)
      Adds the specified nodes to the end of the list of elements of this list node. The nodes are added in the order of the arguments.
      Parameters:
      nodes - the nodes that will be added to the end of the list of elements of this list node.
    • addElements

      public void addElements(Iterable<? extends AbstractNode> nodes)
      Adds the specified nodes to the end of the list of elements of this list node. The nodes are added in the order in which they are returned by their iterator.
      Parameters:
      nodes - the nodes that will be added to the list of elements of this list node.
    • addNull

      public NullNode addNull()
      Creates a new instance of a null node and adds it to the end of the list of elements of this list node.
      Returns:
      the null node that was created and added to the elements of this list node.
    • addBoolean

      public BooleanNode addBoolean(boolean value)
      Creates a new instance of a Boolean node with the specified value, adds it to the end of of the list of elements of this list node and returns it.
      Parameters:
      value - the value of the Boolean node that will be created and added to the elements of this list node.
      Returns:
      the Boolean node that was created from value and added to the elements of this list node.
    • addBooleans

      public void addBooleans(boolean... values)
      Creates new instances of Boolean nodes with the specified values and adds them to the end of the list of elements of this list node, preserving the order of the values.
      Parameters:
      values - the values for which Boolean nodes will be created and added to the elements of this list node.
    • addBooleans

      public void addBooleans(Iterable<Boolean> values)
      Creates new instances of Boolean nodes with the specified values and adds them to the end of the list of elements of this list node, preserving the order of the values.
      Parameters:
      values - the values for which Boolean nodes will be created and added to the elements of this list node.
    • addInt

      public IntNode addInt(int value)
      Creates a new instance of an 'int' node with the specified value, adds it to the end of the list of elements of this list node and returns it.
      Parameters:
      value - the value of the 'int' node that will be created and added to the elements of this list node.
      Returns:
      the 'int' node that was created from value and added to the elements of this list node.
    • addInts

      public void addInts(int... values)
      Creates new instances of 'int' nodes with the specified values and adds them to the end of the list of elements of this list node, preserving the order of the values.
      Parameters:
      values - the values for which 'int' nodes will be created and added to the elements of this list node.
    • addInts

      public void addInts(Iterable<Integer> values)
      Creates new instances of 'int' nodes with the specified values and adds them to the end of the list of elements of this list node, preserving the order of the values.
      Parameters:
      values - the values for which 'int' nodes will be created and added to the elements of this list node.
    • addLong

      public LongNode addLong(long value)
      Creates a new instance of a 'long' node with the specified value, adds it to the end of the list of elements of this list node and returns it.
      Parameters:
      value - the value of the 'long' node that will be created and added to the elements of this list node.
      Returns:
      the 'long' node that was created from value and added to the elements of this list node.
    • addLongs

      public void addLongs(long... values)
      Creates new instances of 'long' nodes with the specified values and adds them to the end of the list of elements of this list node, preserving the order of the values.
      Parameters:
      values - the values for which 'long' nodes will be created and added to the elements of this list node.
    • addLongs

      public void addLongs(Iterable<Long> values)
      Creates new instances of 'long' nodes with the specified values and adds them to the end of the list of elements of this list node, preserving the order of the values.
      Parameters:
      values - the values for which 'long' nodes will be created and added to the elements of this list node.
    • addDouble

      public DoubleNode addDouble(double value)
      Creates a new instance of a 'double' node with the specified value, adds it to the end of the list of elements of this list node and returns it.
      Parameters:
      value - the value of the 'double' node that will be created and added to the elements of this list node.
      Returns:
      the 'double' node that was created from value and added to the elements of this list node.
    • addDoubles

      public void addDoubles(double... values)
      Creates new instances of 'double' nodes with the specified values and adds them to the end of the list of elements of this list node, preserving the order of the values.
      Parameters:
      values - the values for which 'double' nodes will be created and added to the elements of this list node.
    • addDoubles

      public void addDoubles(Iterable<Double> values)
      Creates new instances of 'double' nodes with the specified values and adds them to the end of the list of elements of this list node, preserving the order of the values.
      Parameters:
      values - the values for which 'double' nodes will be created and added to the elements of this list node.
    • addString

      public StringNode addString(String value)
      Creates a new instance of a string node with the specified value, adds it to the end of the list of elements of this list node and returns it.
      Parameters:
      value - the value of the string node that will be created and added to the elements of this list node.
      Returns:
      the string node that was created from value and added to the elements of this list node.
    • addStrings

      public void addStrings(String... values)
      Creates new instances of string nodes with the specified values and adds them to the end of the list of elements of this list node, preserving the order of the values.
      Parameters:
      values - the values for which string nodes will be created and added to the elements of this list node.
    • addStrings

      public void addStrings(Iterable<String> values)
      Creates new instances of string nodes with the specified values and adds them to the end of the list of elements of this list node, preserving the order of the values.
      Parameters:
      values - the values for which string nodes will be created and added to the elements of this list node.
    • addList

      public ListNode addList(AbstractNode... elements)
      Creates a new instance of a list node with the specified elements, adds it to the end of the list of elements of this list node and returns it.
      Parameters:
      elements - the elements of the list node that will be created and added to the elements of this list node.
      Returns:
      the list node that was created from elements and added to the elements of this list node.
    • addList

      public ListNode addList(Iterable<? extends AbstractNode> elements)
      Creates a new instance of a list node with the specified elements, adds it to the end of the list of elements of this list node and returns it.
      Parameters:
      elements - the elements of the list node that will be created and added to the elements of this list node.
      Returns:
      the list node that was created from elements and added to the elements of this list node.
    • addMap

      public MapNode addMap(Map<String,AbstractNode> pairs)
      Creates a new instance of a map node with the specified key–value pairs, adds it to the end of the list of elements of this list node and returns it.
      Parameters:
      pairs - the key–value pairs of the map node that will be created and added to the elements of this list node.
      Returns:
      the map node that was created from pairs and added to the elements of this list node.