public class Ref
extends java.lang.Object
Constructor and Description |
---|
Ref(NNode node) |
Ref(java.lang.String path,
int offset,
java.lang.String text)
Constructor that provides a way for clients to add additional references
not associated with an AST node (e.g.
|
Modifier and Type | Method and Description |
---|---|
int |
end()
Returns the ending file offset of the reference.
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getFile()
Returns the file containing the reference.
|
java.lang.String |
getName()
Returns the text of the reference.
|
int |
hashCode() |
boolean |
isAttribute()
Returns
true if this reference was an attribute
of some other node. |
boolean |
isCall()
Returns
true if this reference is a function or method call. |
boolean |
isName()
Returns
true if this reference was unquoted name. |
boolean |
isNew() |
boolean |
isRef() |
boolean |
isString()
Returns
true if this reference was a quoted name. |
int |
length()
Returns the length of the reference text.
|
void |
markAsAttribute() |
void |
markAsCall()
Returns
true if this reference is a class instantiation. |
void |
markAsNew() |
void |
markAsString() |
int |
start()
Returns the starting file offset of the reference.
|
java.lang.String |
toString() |
public Ref(NNode node)
public Ref(java.lang.String path, int offset, java.lang.String text)
path
- absolute path to the file containing the referenceoffset
- the 0-indexed file offset of the referencetext
- the text of the referencepublic java.lang.String getFile()
public java.lang.String getName()
public int start()
public int end()
public int length()
public boolean isName()
true
if this reference was unquoted name.public boolean isAttribute()
true
if this reference was an attribute
of some other node.public void markAsAttribute()
public boolean isString()
public void markAsString()
public boolean isCall()
true
if this reference is a function or method call.public void markAsCall()
true
if this reference is a class instantiation.public boolean isNew()
public void markAsNew()
public boolean isRef()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object