org.jrubyparser.ast
Class NthRefNode

java.lang.Object
  extended by org.jrubyparser.ast.Node
      extended by org.jrubyparser.ast.NthRefNode
All Implemented Interfaces:
IGlobalVariable, INameMatchable, INameNode, ISourcePositionHolder

public class NthRefNode
extends Node
implements IGlobalVariable

Represents a $number ($0..$9) variable.


Constructor Summary
NthRefNode(SourcePosition position, int matchNumber)
           
 
Method Summary
 Object accept(NodeVisitor iVisitor)
          Accept for the visitor pattern.
 String getLexicalName()
          Get the name including any leading sigils.
 SourcePosition getLexicalNamePosition()
          The position of the name + any sigils that come with it.
 int getMatchNumber()
          Gets the matchNumber.
 String getName()
          Get the plain name without sigils.
 SourcePosition getNamePosition()
          The position of just the name part of the node.
 NodeType getNodeType()
           
 boolean isNameMatch(String name)
           
 boolean isSame(Node node)
          Checks node for 'sameness' for diffing.
 void setName(String newName)
          Set the name (name should not include sigils).
 
Methods inherited from class org.jrubyparser.ast.Node
adopt, adopt, adoptUsingNodesPosition, childNodes, comparePositionWith, createList, getClosestIScope, getClosestModule, getGrandParent, getInlineComment, getInnermostIter, getMethodFor, getNodeAt, getNodeName, 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

NthRefNode

public NthRefNode(SourcePosition position,
                  int matchNumber)
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

getNodeType

public NodeType getNodeType()
Specified by:
getNodeType in class Node
Returns:
the nodeId

accept

public Object accept(NodeVisitor iVisitor)
Accept for the visitor pattern.

Specified by:
accept in class Node
Parameters:
iVisitor - the visitor

getMatchNumber

public int getMatchNumber()
Gets the matchNumber.

Returns:
Returns a int

getName

public String getName()
Description copied from interface: INameNode
Get the plain name without sigils.

Specified by:
getName in interface INameNode

getLexicalName

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

Specified by:
getLexicalName in interface INameNode

setName

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

Specified by:
setName in interface INameNode

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

isNameMatch

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


Copyright © 2013. All Rights Reserved.