org.fife.rsta.ac.java.rjc.ast
Class Method

java.lang.Object
  extended by org.fife.rsta.ac.java.rjc.ast.Method
All Implemented Interfaces:
ASTNode, Member

public class Method
extends Object


Constructor Summary
Method(Scanner s, Modifiers modifiers, Type type, Token nameToken, List params, List thrownTypeNames)
           
 
Method Summary
 CodeBlock getBody()
           
 boolean getBodyContainsOffset(int offs)
           
 int getBodyEndOffset()
           
 int getBodyStartOffset()
           
 String getDocComment()
           
 Modifiers getModifiers()
           
 String getName()
          Returns the "name" of this node.
 String getNameAndParameters()
           
 int getNameEndOffset()
          Returns the end offset of the "name" of this node.
 int getNameStartOffset()
          Returns the start offset of the "name" of this node.
 FormalParameter getParameter(int index)
           
 int getParameterCount()
           
 Iterator getParameterIterator()
           
 TypeDeclaration getParentTypeDeclaration()
           
 int getThrownTypeNameCount()
           
 Type getType()
           
 boolean isConstructor()
           
 boolean isDeprecated()
           
 void setBody(CodeBlock body)
           
 void setDeclarationEndOffset(Offset end)
           
protected  void setDeclarationOffsets(Offset start, Offset end)
          Sets the start and end offsets of this node.
 void setDeprecated(boolean deprecated)
           
 void setDocComment(String comment)
           
 void setParentTypeDeclaration(TypeDeclaration dec)
          
 String toString()
          Returns the name of this node (e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.fife.rsta.ac.java.rjc.ast.Member
getName, getNameEndOffset, getNameStartOffset
 

Constructor Detail

Method

public Method(Scanner s,
              Modifiers modifiers,
              Type type,
              Token nameToken,
              List params,
              List thrownTypeNames)
Method Detail

getBody

public CodeBlock getBody()

getBodyContainsOffset

public boolean getBodyContainsOffset(int offs)

getBodyEndOffset

public int getBodyEndOffset()

getBodyStartOffset

public int getBodyStartOffset()

getDocComment

public String getDocComment()

getModifiers

public Modifiers getModifiers()

getNameAndParameters

public String getNameAndParameters()

getParameter

public FormalParameter getParameter(int index)

getParameterCount

public int getParameterCount()

getParameterIterator

public Iterator getParameterIterator()

getThrownTypeNameCount

public int getThrownTypeNameCount()

getType

public Type getType()

isConstructor

public boolean isConstructor()

isDeprecated

public boolean isDeprecated()

setBody

public void setBody(CodeBlock body)

setDeprecated

public void setDeprecated(boolean deprecated)

setDocComment

public void setDocComment(String comment)

getParentTypeDeclaration

public TypeDeclaration getParentTypeDeclaration()
Specified by:
getParentTypeDeclaration in interface Member

setParentTypeDeclaration

public void setParentTypeDeclaration(TypeDeclaration dec)

Specified by:
setParentTypeDeclaration in interface Member

getName

public String getName()
Returns the "name" of this node. This will be the name of the method, the name of the member or local variable, etc. For CodeBlocks it will be CodeBlock.NAME.

Note that this may not be unique. For example, a class with an overloaded method will have multiple methods with the same "name," just with different signatures.

Specified by:
getName in interface ASTNode
Returns:
The "name" of this node.

getNameEndOffset

public int getNameEndOffset()
Returns the end offset of the "name" of this node.

Specified by:
getNameEndOffset in interface ASTNode
Returns:
The end offset.

getNameStartOffset

public int getNameStartOffset()
Returns the start offset of the "name" of this node.

Specified by:
getNameStartOffset in interface ASTNode
Returns:
The start offset.

setDeclarationEndOffset

public void setDeclarationEndOffset(Offset end)

setDeclarationOffsets

protected void setDeclarationOffsets(Offset start,
                                     Offset end)
Sets the start and end offsets of this node.

Parameters:
start - The start offset.
end - The end offset.

toString

public String toString()
Returns the name of this node (e.g. the value of getName()). Subclasses can override this method if appropriate.

Overrides:
toString in class Object
Returns:
A string representation of this node.


Copyright © 2003-2011. All Rights Reserved.