Package uk.blankaspect.common.basictree
Class ListNode
java.lang.Object
uk.blankaspect.common.basictree.AbstractNode
uk.blankaspect.common.basictree.ListNode
- All Implemented Interfaces:
Cloneable
,Iterable<AbstractNode>
,ITreeNode<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
Modifier and TypeFieldDescriptionstatic 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
ConstructorDescriptionListNode()
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.ListNode
(AbstractNode parent) 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 TypeMethodDescriptionvoid
add
(AbstractNode node) 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
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.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
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.void
addElements
(Iterable<? extends AbstractNode> nodes) Adds the specified nodes to the end of the list of elements of this list node.void
addElements
(AbstractNode... nodes) 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.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.addNull()
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
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.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
clear()
Removes all the elements of this list node.clone()
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
Returnstrue
if the specified object is an instance ofListNode
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 ofboolean
s.Returns the underlying values of the elements of this list node as a list ofBoolean
s.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 ofdouble
s.Returns the underlying values of the elements of this list node as a list ofDouble
s.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 ofint
s.Returns the underlying values of the elements of this list node as a list ofInteger
s.long[]
Returns the underlying values of the elements of this list node as an array oflong
s.Returns the underlying values of the elements of this list node as a list ofLong
s.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 oflong
s.Returns the underlying values of the elements of this list node as a list ofLong
s.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.String[]
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.getType()
Returns the type of this node.int
hashCode()
Returns the hash code of this list node, which is the hash code of its elements.int
indexOf
(AbstractNode node) Returns the index of the specified node in the list of the elements of this list node.intNodes()
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
Returnstrue
if this node can contain other nodes.boolean
isEmpty()
Returnstrue
if this list node contains no elements.iterator()
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.mapNodes()
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
setElements
(AbstractNode... nodes) 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.toString()
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
-
Field Details
-
START_CHAR
public static final char START_CHARThe character that denotes the start of the string representation of a list node.- See Also:
-
END_CHAR
public static final char END_CHARThe character that denotes the end of the string representation of a list node.- See Also:
-
ELEMENT_SEPARATOR_CHAR
public static final char ELEMENT_SEPARATOR_CHARThe character that separates adjacent elements in the string representation of a list node.- See Also:
-
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
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
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
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
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
Description copied from class:AbstractNode
Returns the type of this node.- Specified by:
getType
in classAbstractNode
- Returns:
TYPE
.
-
isContainer
public boolean isContainer()Returnstrue
if this node can contain other nodes. For a list node, this method always returnstrue
.- Specified by:
isContainer
in classAbstractNode
- Returns:
true
.
-
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 interfaceITreeNode<AbstractNode>
- Overrides:
getChildren
in classAbstractNode
- Returns:
- a list of the elements of this list node.
- See Also:
-
iterator
Returns an iterator over the elements of this list node.- Specified by:
iterator
in interfaceIterable<AbstractNode>
- Returns:
- an iterator over the elements of this list node.
-
equals
Returnstrue
if the specified object is an instance ofListNode
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 classObject
- Parameters:
obj
- the object with which this list node will be compared.- Returns:
true
ifobj
is an instance ofListNode
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. -
clone
Creates and returns a deep copy of this list node that has no parent.- Overrides:
clone
in classAbstractNode
- Returns:
- a deep copy of this list node that has no parent.
-
toString
Returns a string representation of this list node. -
isEmpty
public boolean isEmpty()Returnstrue
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
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
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 aNullNode
. - Throws:
IndexOutOfBoundsException
- if (index
< 0) or (index
>=getNumElements()
).ClassCastException
- if the element atindex
is not an instance ofNullNode
.
-
getBoolean
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 aBooleanNode
. - Throws:
IndexOutOfBoundsException
- if (index
< 0) or (index
>=getNumElements()
).ClassCastException
- if the element atindex
is not an instance ofBooleanNode
.
-
getInt
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 aIntNode
. - Throws:
IndexOutOfBoundsException
- if (index
< 0) or (index
>=getNumElements()
).ClassCastException
- if the element atindex
is not an instance ofIntNode
.
-
getLong
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 aLongNode
. - Throws:
IndexOutOfBoundsException
- if (index
< 0) or (index
>=getNumElements()
).ClassCastException
- if the element atindex
is not an instance ofLongNode
.
-
getDouble
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 aDoubleNode
. - Throws:
IndexOutOfBoundsException
- if (index
< 0) or (index
>=getNumElements()
).ClassCastException
- if the element atindex
is not an instance ofDoubleNode
.
-
getString
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 aStringNode
. - Throws:
IndexOutOfBoundsException
- if (index
< 0) or (index
>=getNumElements()
).ClassCastException
- if the element atindex
is not an instance ofStringNode
.
-
getList
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 aListNode
. - Throws:
IndexOutOfBoundsException
- if (index
< 0) or (index
>=getNumElements()
).ClassCastException
- if the element atindex
is not an instance ofListNode
.
-
getMap
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 aMapNode
. - Throws:
IndexOutOfBoundsException
- if (index
< 0) or (index
>=getNumElements()
).ClassCastException
- if the element atindex
is not an instance ofMapNode
.
-
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
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
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 ofboolean
s.- 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
Returns the underlying values of the elements of this list node as a list ofBoolean
s.- 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
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
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 ofint
s.- 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
Returns the underlying values of the elements of this list node as a list ofInteger
s.- 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
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
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 oflong
s.- 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
Returns the underlying values of the elements of this list node as a list ofLong
s.- 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 oflong
s. 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
Returns the underlying values of the elements of this list node as a list ofLong
s. 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
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
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 ofdouble
s.- 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
Returns the underlying values of the elements of this list node as a list ofDouble
s.- 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
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
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
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
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
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
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
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
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
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 ifnode
is not an element of this list node.
-
clear
public void clear()Removes all the elements of this list node. -
setElements
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
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
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
- ifnode
isnull
.
-
addElements
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
-