Package org.jruby.ast
Class ListNode
java.lang.Object
org.jruby.ast.Node
org.jruby.ast.ListNode
- Direct Known Subclasses:
ArrayNode
,BlockNode
,DNode
,ZArrayNode
All Nodes which have a list representation inherit this. This is also used
as generic container for additional information that is not directly evaluated.
In particular, f_arg production rule uses this to capture arg information for
the editor projects who want position info saved.
-
Field Summary
Fields inherited from class org.jruby.ast.Node
containsVariableAssignment, newline
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> T
accept
(NodeVisitor<T> visitor) Add all elements in other list to this list node.Add other element to this listprotected void
addAllInternal
(ListNode other) protected void
addInternal
(Node node) Deprecated.Node[]
children()
get
(int idx) getLast()
boolean
isEmpty()
iterator()
int
size()
Methods inherited from class org.jruby.ast.Node
containsVariableAssignment, createList, createList, createList, createList, executesOnce, getFile, getLine, getNodeName, isNewline, isNil, needsDefinitionCheck, setLine, setNewline, toString, toString, toStringExtraInfo, toStringInternal, unsetNewline
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ListNode
Create a new ListNode.- Parameters:
line
- where list isfirstNode
- first element of the list
-
ListNode
public ListNode(int line)
-
-
Method Details
-
getNodeType
- Specified by:
getNodeType
in classNode
- Returns:
- the nodeId
-
addInternal
-
addAllInternal
-
add
-
size
public int size() -
addAll
Add all elements in other list to this list node.- Parameters:
other
- list which has elements- Returns:
- this instance for method chaining
-
addAll
-
addAll
Add other element to this list- Parameters:
other
- list which has elements- Returns:
- this instance for method chaining
-
getLast
-
isEmpty
public boolean isEmpty() -
children
-
childNodes
Deprecated.- Specified by:
childNodes
in classNode
-
accept
-
get
-
iterator
-