Top Description Fields Constructors Methods
org.jruby.ast

public Class ClassNode

extends Node
implements IScopingNode
Class Inheritance
All Implemented Interfaces
org.jruby.ast.IScopingNode
Imports
java.util.List, org.jruby.ast.visitor.NodeVisitor, org.jruby.parser.StaticScope

A class statement (name, superClass, body). Classes bodies also define their own scope.

Field Summary

Modifier and TypeField and Description
private final Node
private final Colon3Node
private final int
private final StaticScope
private final Node
Inherited from org.jruby.ast.Node:
containsVariableAssignmentEMPTY_LISTnewline

Constructor Summary

AccessConstructor and Description
public
ClassNode(int line, Colon3Node cpath, StaticScope scope, Node bodyNode, Node superNode, int endLine)

Method Summary

Modifier and TypeMethod and Description
public <T> T
accept(NodeVisitor<T>
the visitor
iVisitor
)

Implements abstract org.jruby.ast.Node.accept.

Accept for the visitor pattern.

public List<Node>
public boolean
public Node

Returns:

the contents
getBodyNode
()

Implements org.jruby.ast.IScopingNode.getBodyNode.

Gets the body of this class.

public Colon3Node

Returns:

Returns representation of class path+name
getCPath
()

Implements org.jruby.ast.IScopingNode.getCPath.

Gets the className.

public int
getEndLine()

Gets line where the 'end' was for this module.

public NodeType
public StaticScope

Returns:

the scoping info
getScope
()

Implements org.jruby.ast.IScopingNode.getScope.

Get the static scoping information.

public Node

Returns:

Returns a Node
getSuperNode
()

Gets the superNode.

Inherited from org.jruby.ast.Node:
containsVariableAssignmentcreateListcreateListcreateListcreateListgetFilegetLinegetNodeNameisNewlineisNilneedsDefinitionChecksetLinesetNewlinetoStringtoStringtoStringExtraInfotoStringInternalunsetNewline

Field Detail

bodyNodeback to summary
private final Node bodyNode
cpathback to summary
private final Colon3Node cpath
endLineback to summary
private final int endLine
scopeback to summary
private final StaticScope scope
superNodeback to summary
private final Node superNode

Constructor Detail

ClassNodeback to summary
public ClassNode(int line, Colon3Node cpath, StaticScope scope, Node bodyNode, Node superNode, int endLine)

Method Detail

acceptback to summary
public <T> T accept(NodeVisitor<T> iVisitor)

Implements abstract org.jruby.ast.Node.accept.

Accept for the visitor pattern.

Parameters
iVisitor:NodeVisitor<T>

the visitor

childNodesback to summary
public List<Node> childNodes()

Implements abstract org.jruby.ast.Node.childNodes.

executesOnceback to summary
public boolean executesOnce()

Overrides org.jruby.ast.Node.executesOnce.

Returns:boolean

Doc from org.jruby.ast.Node.executesOnce.

is it possible this node will execute only once.

Note

This is not comprehensive. It is used to look from root node down to class/module nodes to make sure that narrow case can execute once. It is possible much deeper down the tree some nodes can only execute once but it will be marked as false because that case is not what this is for.

Annotations
@Override
getBodyNodeback to summary
public Node getBodyNode()

Implements org.jruby.ast.IScopingNode.getBodyNode.

Gets the body of this class.

Returns:Node

the contents

getCPathback to summary
public Colon3Node getCPath()

Implements org.jruby.ast.IScopingNode.getCPath.

Gets the className.

Returns:Colon3Node

Returns representation of class path+name

getEndLineback to summary
public int getEndLine()

Gets line where the 'end' was for this module.

getNodeTypeback to summary
public NodeType getNodeType()

Implements abstract org.jruby.ast.Node.getNodeType.

Returns:NodeType

Doc from org.jruby.ast.Node.getNodeType.

the nodeId

getScopeback to summary
public StaticScope getScope()

Implements org.jruby.ast.IScopingNode.getScope.

Get the static scoping information.

Returns:StaticScope

the scoping info

getSuperNodeback to summary
public Node getSuperNode()

Gets the superNode.

Returns:Node

Returns a Node