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> Taccept(NodeVisitor<T> visitor) Add all elements in other list to this list node.Add other element to this listprotected voidaddAllInternal(ListNode other) protected voidaddInternal(Node node) Deprecated.Node[]children()get(int idx) getLast()booleanisEmpty()iterator()intsize()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, unsetNewlineMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
getNodeTypein 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:
childNodesin classNode
-
accept
-
get
-
iterator
-