public class Try extends BranchStatement implements StatementContainer, ProgramPrefix
| Modifier and Type | Field and Description | 
|---|---|
private StatementBlock | 
body
Body. 
 | 
private ImmutableArray<Branch> | 
branches
Branches. 
 | 
private MethodFrame | 
innerMostMethodFrame  | 
private int | 
prefixLength  | 
| Constructor and Description | 
|---|
Try(ExtList children)
Try. 
 | 
Try(StatementBlock body)
Try. 
 | 
Try(StatementBlock body,
   Branch[] branches)
Try. 
 | 
Try(StatementBlock body,
   ImmutableArray<Branch> branches)
Try. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
StatementBlock | 
getBody()
Get body. 
 | 
Branch | 
getBranchAt(int index)
Return the branch at the specified index in this node's
      "virtual" branch array. 
 | 
int | 
getBranchCount()
Get the number of branches in this container. 
 | 
ImmutableArray<Branch> | 
getBranchList()
Return the branch array wrapper 
 | 
ProgramElement | 
getChildAt(int index)
Returns the child at the specified index in this node's "virtual"
      child array 
 | 
int | 
getChildCount()
Returns the number of children of this node. 
 | 
PosInProgram | 
getFirstActiveChildPos()
returns the position of the first active child 
 | 
SourceElement | 
getFirstElement()
Finds the source element that occurs first in the source. 
 | 
MethodFrame | 
getInnerMostMethodFrame()
returns the inner most  
MethodFrame | 
SourceElement | 
getLastElement()
Finds the source element that occurs last in the source. 
 | 
ProgramPrefix | 
getLastPrefixElement()
return the last prefix element 
 | 
ProgramPrefix | 
getNextPrefixElement()
return the next prefix element 
 if no next prefix element is available an IndexOutOfBoundsException is thrown 
 | 
ImmutableArray<ProgramPrefix> | 
getPrefixElements()
returns an array with all prefix elements starting at 
 this element 
 | 
int | 
getPrefixLength()
returns the length of the prefix 
 | 
Statement | 
getStatementAt(int index)  | 
int | 
getStatementCount()
Get the number of statements in this container. 
 | 
boolean | 
hasNextPrefixElement()
return true if there is a next prefix element 
 | 
void | 
prettyPrint(PrettyPrinter p)
Pretty printing the source element. 
 | 
void | 
visit(Visitor v)
calls the corresponding method of a visitor in order to
 perform some action/transformation on this element 
 | 
compatibleBlockSize, computeHashCode, equals, equalsModRenaming, getArrayPos, match, matchChildrengetComments, hashCode, prettyPrintMain, reuseSignaturegetEndPosition, getFirstElementIncludingBlocks, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetComments, matchequalsModRenaming, getEndPosition, getFirstElementIncludingBlocks, getPositionInfo, getRelativePosition, getStartPositionprivate final StatementBlock body
private final ImmutableArray<Branch> branches
private final MethodFrame innerMostMethodFrame
private final int prefixLength
public Try(StatementBlock body)
body - a statement block.public Try(StatementBlock body, Branch[] branches)
body - a statement block.branches - a branch array.public Try(StatementBlock body, ImmutableArray<Branch> branches)
body - a statement block.branches - a branch array.public Try(ExtList children)
children - a list with all childrenpublic boolean hasNextPrefixElement()
ProgramPrefixhasNextPrefixElement in interface ProgramPrefixpublic ProgramPrefix getNextPrefixElement()
ProgramPrefixgetNextPrefixElement in interface ProgramPrefixpublic ProgramPrefix getLastPrefixElement()
ProgramPrefixgetLastPrefixElement in interface ProgramPrefixpublic int getPrefixLength()
ProgramPrefixgetPrefixLength in interface ProgramPrefixpublic MethodFrame getInnerMostMethodFrame()
ProgramPrefixMethodFramegetInnerMostMethodFrame in interface ProgramPrefixpublic ImmutableArray<ProgramPrefix> getPrefixElements()
ProgramPrefixgetPrefixElements in interface ProgramPrefixpublic SourceElement getFirstElement()
JavaSourceElementgetFirstElement in interface SourceElementgetFirstElement in class JavaSourceElementJavaSourceElement.toSource(), 
JavaSourceElement.getStartPosition()public SourceElement getLastElement()
JavaSourceElementgetLastElement in interface SourceElementgetLastElement in class JavaSourceElementJavaSourceElement.toSource(), 
JavaSourceElement.getEndPosition()public int getChildCount()
getChildCount in interface NonTerminalProgramElementpublic ProgramElement getChildAt(int index)
getChildAt in interface NonTerminalProgramElementindex - an index into this node's "virtual" child arrayjava.lang.ArrayIndexOutOfBoundsException - if index is out
                 of boundspublic StatementBlock getBody()
public int getStatementCount()
getStatementCount in interface StatementContainerpublic Statement getStatementAt(int index)
getStatementAt in interface StatementContainerpublic int getBranchCount()
getBranchCount in class BranchStatementpublic Branch getBranchAt(int index)
getBranchAt in class BranchStatementindex - an index for a branch.java.lang.ArrayIndexOutOfBoundsException - if index is out
      of bounds.public ImmutableArray<Branch> getBranchList()
public void visit(Visitor v)
visit in interface SourceElementv - the Visitorpublic void prettyPrint(PrettyPrinter p) throws java.io.IOException
JavaSourceElementprettyPrint in interface SourceElementprettyPrint in class JavaProgramElementp - a pretty printer.java.io.IOException - occasionally thrown.public PosInProgram getFirstActiveChildPos()
ProgramPrefixgetFirstActiveChildPos in interface ProgramPrefix