Package org.fife.rsta.ac.java.rjc.ast
Class Method
- java.lang.Object
-
- org.fife.rsta.ac.java.rjc.ast.AbstractASTNode
-
- org.fife.rsta.ac.java.rjc.ast.AbstractMember
-
- org.fife.rsta.ac.java.rjc.ast.Method
-
public class Method extends AbstractMember
Represents a method in a Java type.- Version:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private CodeBlockbodyprivate booleandeprecatedprivate java.lang.StringdocCommentprivate Modifiersmodifiersprivate java.util.List<FormalParameter>parametersprivate java.util.List<java.lang.String>thrownTypeNamesprivate Typetype
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CodeBlockgetBody()booleangetBodyContainsOffset(int offs)Returns whether this method's body contains the specified offset.intgetBodyEndOffset()intgetBodyStartOffset()java.lang.StringgetDocComment()Returns the doc comment for this member.ModifiersgetModifiers()Returns the modifiers of this member.java.lang.StringgetNameAndParameters()Returns this method name and parameters, as a string, in the formatmethodName(Type1 param1, Type2 param2).FormalParametergetParameter(int index)Returns the specified formal parameter.intgetParameterCount()java.util.Iterator<FormalParameter>getParameterIterator()intgetThrownTypeNameCount()TypegetType()Returns the type of this member.booleanisConstructor()booleanisDeprecated()Returns whether this member is deprecated.voidsetBody(CodeBlock body)voidsetDeprecated(boolean deprecated)voidsetDocComment(java.lang.String comment)-
Methods inherited from class org.fife.rsta.ac.java.rjc.ast.AbstractMember
getParentTypeDeclaration, isStatic, setParentTypeDeclaration
-
Methods inherited from class org.fife.rsta.ac.java.rjc.ast.AbstractASTNode
getName, getNameEndOffset, getNameStartOffset, setDeclarationEndOffset, setDeclarationOffsets, toString
-
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
-
-
-
-
Field Detail
-
modifiers
private Modifiers modifiers
-
type
private Type type
-
parameters
private java.util.List<FormalParameter> parameters
-
thrownTypeNames
private java.util.List<java.lang.String> thrownTypeNames
-
body
private CodeBlock body
-
deprecated
private boolean deprecated
-
docComment
private java.lang.String docComment
-
-
Constructor Detail
-
Method
public Method(Scanner s, Modifiers modifiers, Type type, Token nameToken, java.util.List<FormalParameter> params, java.util.List<java.lang.String> thrownTypeNames)
-
-
Method Detail
-
getBody
public CodeBlock getBody()
-
getBodyContainsOffset
public boolean getBodyContainsOffset(int offs)
Returns whether this method's body contains the specified offset.- Parameters:
offs- The offset to check.- Returns:
- Whether this method's body contains that offset.
-
getBodyEndOffset
public int getBodyEndOffset()
-
getBodyStartOffset
public int getBodyStartOffset()
-
getDocComment
public java.lang.String getDocComment()
Description copied from interface:MemberReturns the doc comment for this member.- Returns:
- This member's doc comment.
-
getModifiers
public Modifiers getModifiers()
Description copied from interface:MemberReturns the modifiers of this member.- Returns:
- The modifiers.
-
getNameAndParameters
public java.lang.String getNameAndParameters()
Returns this method name and parameters, as a string, in the formatmethodName(Type1 param1, Type2 param2).- Returns:
- This method's name and parameters.
-
getParameter
public FormalParameter getParameter(int index)
Returns the specified formal parameter.- Parameters:
index- The parameter's index.- Returns:
- The formal parameter.
- See Also:
getParameterCount()
-
getParameterCount
public int getParameterCount()
-
getParameterIterator
public java.util.Iterator<FormalParameter> getParameterIterator()
-
getThrownTypeNameCount
public int getThrownTypeNameCount()
-
getType
public Type getType()
Description copied from interface:MemberReturns the type of this member.- Returns:
- This member's type.
-
isConstructor
public boolean isConstructor()
-
isDeprecated
public boolean isDeprecated()
Description copied from interface:MemberReturns whether this member is deprecated.- Returns:
- Whether this member is deprecated.
-
setBody
public void setBody(CodeBlock body)
-
setDeprecated
public void setDeprecated(boolean deprecated)
-
setDocComment
public void setDocComment(java.lang.String comment)
-
-