org.jrubyparser.ast
Class MethodDefNode

java.lang.Object
  extended by org.jrubyparser.ast.Node
      extended by org.jrubyparser.ast.MethodDefNode
All Implemented Interfaces:
ILocalScope, INameMatchable, INameNode, IParameterScope, IScope, ISourcePositionHolder
Direct Known Subclasses:
DefnNode, DefsNode

public abstract class MethodDefNode
extends Node
implements INameNode, ILocalScope, IParameterScope


Field Summary
protected  ArgsNode argsNode
           
protected  Node bodyNode
           
protected  MethodNameNode nameNode
           
protected  StaticScope scope
           
 
Constructor Summary
MethodDefNode(SourcePosition position, MethodNameNode nameNode, ArgsNode argsNode, StaticScope scope, Node bodyNode)
           
 
Method Summary
 ArgsNode getArgs()
          Gets the argsNode.
 ArgsNode getArgsNode()
          Deprecated. 
 Node getBody()
          Gets the body of this class.
 Node getBodyNode()
          Deprecated. 
 String getLexicalName()
          Get the name including any leading sigils.
 SourcePosition getLexicalNamePosition()
          The position of the name + any sigils that come with it.
 String getName()
          Gets the name.
 MethodNameNode getNameNode()
          Gets the name's node.
 SourcePosition getNamePosition()
          The position of just the name part of the node.
 String getNormativeSignature()
          Note: This will give a string a representation which will always be consistent whether you specify a method definition using parens or not.
 ILocalVariable getParameterNamed(String name)
           
 StaticScope getScope()
          Get the static scoping information.
 boolean isNameMatch(String name)
           
 boolean isParameterUsed(String name)
          Given a name (presumably retrieve via getNormativeSignatureNameList()) is this parmeter used in this method definition?
 boolean isSame(Node node)
          Checks node for 'sameness' for diffing.
 void setName(String name)
          Set the name (name should not include sigils).
 
Methods inherited from class org.jrubyparser.ast.Node
accept, adopt, adopt, adoptUsingNodesPosition, childNodes, comparePositionWith, createList, getClosestIScope, getClosestModule, getGrandParent, getInlineComment, getInnermostIter, getMethodFor, getNodeAt, getNodeName, getNodeType, getOutermostIter, getParent, getPosition, getPositionIncludingComments, getPreviousComments, insertAfter, insertAll, insertBefore, insertNode, isBlockParameter, isDescendentOf, isLeaf, isMethodParameter, setParent, setPosition, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jrubyparser.ast.IScope
getVariableReferencesNamed
 

Field Detail

nameNode

protected MethodNameNode nameNode

argsNode

protected ArgsNode argsNode

scope

protected StaticScope scope

bodyNode

protected Node bodyNode
Constructor Detail

MethodDefNode

public MethodDefNode(SourcePosition position,
                     MethodNameNode nameNode,
                     ArgsNode argsNode,
                     StaticScope scope,
                     Node bodyNode)
Method Detail

isSame

public boolean isSame(Node node)
Checks node for 'sameness' for diffing.

Overrides:
isSame in class Node
Parameters:
node - to be compared to
Returns:
Returns a boolean

getArgs

public ArgsNode getArgs()
Gets the argsNode.

Returns:
Returns a Node

getArgsNode

@Deprecated
public ArgsNode getArgsNode()
Deprecated. 


getScope

public StaticScope getScope()
Get the static scoping information.

Returns:
the scoping info

getBody

public Node getBody()
Gets the body of this class.

Returns:
the contents

getBodyNode

@Deprecated
public Node getBodyNode()
Deprecated. 


getLexicalName

public String getLexicalName()
Description copied from interface: INameNode
Get the name including any leading sigils.

Specified by:
getLexicalName in interface INameNode

getNameNode

public MethodNameNode getNameNode()
Gets the name's node.

Returns:
Returns an ArgumentNode

getName

public String getName()
Gets the name.

Specified by:
getName in interface INameNode
Returns:
Returns a String

setName

public void setName(String name)
Description copied from interface: INameNode
Set the name (name should not include sigils).

Specified by:
setName in interface INameNode

isNameMatch

public boolean isNameMatch(String name)
Specified by:
isNameMatch in interface INameMatchable

getNamePosition

public SourcePosition getNamePosition()
Description copied from interface: INameNode
The position of just the name part of the node.

Specified by:
getNamePosition in interface INameNode

getLexicalNamePosition

public SourcePosition getLexicalNamePosition()
Description copied from interface: INameNode
The position of the name + any sigils that come with it.

Specified by:
getLexicalNamePosition in interface INameNode

isParameterUsed

public boolean isParameterUsed(String name)
Given a name (presumably retrieve via getNormativeSignatureNameList()) is this parmeter used in this method definition?

Specified by:
isParameterUsed in interface IParameterScope
Parameters:
name -
Returns:
if used or not.

getParameterNamed

public ILocalVariable getParameterNamed(String name)
Specified by:
getParameterNamed in interface IParameterScope

getNormativeSignature

public String getNormativeSignature()
Note: This will give a string a representation which will always be consistent whether you specify a method definition using parens or not. It is meant for use of IDES for indexing of hinting on completion.



Copyright © 2013. All Rights Reserved.