org.jruby.ast
Class ListNode
java.lang.Object
org.jruby.ast.Node
org.jruby.ast.ListNode
- All Implemented Interfaces:
- ISourcePositionHolder
- Direct Known Subclasses:
- ArrayNode, BlockNode, DRegexpNode, DStrNode, DSymbolNode, DXStrNode
public class ListNode
- extends Node
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ListNode
public ListNode(ISourcePosition position,
Node firstNode)
- Create a new ListNode.
- Parameters:
id
- type of listnodefirstNode
- first element of the list
ListNode
public ListNode(ISourcePosition position)
getNodeType
public NodeType getNodeType()
- Specified by:
getNodeType
in class Node
- Returns:
- the nodeId
add
public ListNode add(Node node)
prepend
public ListNode prepend(Node node)
size
public int size()
addAll
public ListNode addAll(ListNode other)
- Add all elements in other list to this list node.
- Parameters:
other
- list which has elements
- Returns:
- this instance for method chaining
addAll
public ListNode addAll(Node other)
- Add other element to this list
- Parameters:
other
- list which has elements
- Returns:
- this instance for method chaining
getLast
public Node getLast()
childNodes
public java.util.List<Node> childNodes()
- Specified by:
childNodes
in class Node
accept
public java.lang.Object accept(NodeVisitor visitor)
- Specified by:
accept
in class Node
get
public Node get(int idx)
Copyright © 2002-2009 JRuby Team. All Rights Reserved.