Top Description Fields Constructors Methods
org.codehaus.groovy.classgen

public Class BytecodeSequence

extends Statement
Class Inheritance
Known Direct Subclasses
org.codehaus.groovy.classgen.Verifier.SwapInitStatement
Imports
org.codehaus.groovy.ast.ASTNode, .GroovyCodeVisitor, org.codehaus.groovy.ast.stmt.Statement, java.util.Collections, .List, .Objects

This class represents a sequence of BytecodeInstructions or ASTNodes. The evaluation is depending on the type of the visitor.

Field Summary

Modifier and TypeField and Description
private final List<?>

Constructor Summary

AccessConstructor and Description
public
public
BytecodeSequence(final List<?> instructions)

Method Summary

Modifier and TypeMethod and Description
public BytecodeInstruction

Returns:

null if instruction(s) is not a BytecodeInstruction
getBytecodeInstruction
()

Returns the singular BytecodeInstruction.

public List<?>
public void
visit(final GroovyCodeVisitor visitor)

Overrides org.codehaus.groovy.ast.ASTNode.visit.

Delegates to the visit method used for this class.
Inherited from org.codehaus.groovy.ast.stmt.Statement:
addStatementLabelcopyStatementLabelsgetStatementLabelgetStatementLabelsisEmptysetStatementLabel

Field Detail

instructionsback to summary
private final List<?> instructions

Constructor Detail

BytecodeSequenceback to summary
public BytecodeSequence(final BytecodeInstruction instruction)
BytecodeSequenceback to summary
public BytecodeSequence(final List<?> instructions)

Method Detail

getBytecodeInstructionback to summary
public BytecodeInstruction getBytecodeInstruction()

Returns the singular BytecodeInstruction.

Returns:BytecodeInstruction

null if instruction(s) is not a BytecodeInstruction

getInstructionsback to summary
public List<?> getInstructions()
visitback to summary
public void visit(final GroovyCodeVisitor visitor)

Overrides org.codehaus.groovy.ast.ASTNode.visit.

Delegates to the visit method used for this class. If the visitor is a ClassGenerator, then ClassGenerator#visitBytecodeSequence(BytecodeSequence) is called with this instance. If the visitor is no ClassGenerator, then this method will call visit on each ASTNode element sorted by this class. If one element is a BytecodeInstruction, then it will be skipped as it is no ASTNode.

See Also
ClassGenerator