org.jrubyparser.ast
Class NamedNode

java.lang.Object
  extended by org.jrubyparser.ast.Node
      extended by org.jrubyparser.ast.NamedNode
All Implemented Interfaces:
INameMatchable, INameNode, ISourcePositionHolder
Direct Known Subclasses:
BlockArgNode, DVarNode, LocalVarNode, MethodNameNode, SymbolNode, VCallNode

public abstract class NamedNode
extends Node
implements INameNode

Nodes with string names are very common.


Constructor Summary
NamedNode(SourcePosition position, String name)
           
 
Method Summary
 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.
 SourcePosition getNamePosition()
          The position of just the name part of the node.
 boolean isNameMatch(String testName)
          Does the supplied name match this one?
 boolean isSame(Node node)
          Checks node for 'sameness' for diffing.
 void setName(String name)
          Sets the name (for refactoring support)
 
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
 

Constructor Detail

NamedNode

public NamedNode(SourcePosition position,
                 String name)
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

getLexicalName

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

Specified by:
getLexicalName in interface INameNode

getName

public String getName()
Gets the name.

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

setName

public void setName(String name)
Sets the name (for refactoring support)

Specified by:
setName in interface INameNode
Parameters:
name - is the new name

isNameMatch

public boolean isNameMatch(String testName)
Does the supplied name match this one?

Specified by:
isNameMatch in interface INameMatchable
Parameters:
testName -

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


Copyright © 2013. All Rights Reserved.