org.python.indexer
Class Ref
- java.lang.Object
-
- org.python.indexer.Ref
-
public class Ref extends java.lang.ObjectEncapsulates information about a binding reference.
-
-
Constructor Summary
Constructors 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intend()Returns the ending file offset of the reference.booleanequals(java.lang.Object obj)java.lang.StringgetFile()Returns the file containing the reference.java.lang.StringgetName()Returns the text of the reference.inthashCode()booleanisAttribute()Returnstrueif this reference was an attribute of some other node.booleanisCall()Returnstrueif this reference is a function or method call.booleanisName()Returnstrueif this reference was unquoted name.booleanisNew()booleanisRef()booleanisString()Returnstrueif this reference was a quoted name.intlength()Returns the length of the reference text.voidmarkAsAttribute()voidmarkAsCall()Returnstrueif this reference is a class instantiation.voidmarkAsNew()voidmarkAsString()intstart()Returns the starting file offset of the reference.java.lang.StringtoString()
-
-
-
Constructor Detail
-
Ref
public Ref(NNode node)
-
Ref
public 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. inside a comment or doc string).- Parameters:
path- absolute path to the file containing the referenceoffset- the 0-indexed file offset of the referencetext- the text of the reference
-
-
Method Detail
-
getFile
public java.lang.String getFile()
Returns the file containing the reference.
-
getName
public java.lang.String getName()
Returns the text of the reference.
-
start
public int start()
Returns the starting file offset of the reference.
-
end
public int end()
Returns the ending file offset of the reference.
-
length
public int length()
Returns the length of the reference text.
-
isName
public boolean isName()
Returnstrueif this reference was unquoted name.
-
isAttribute
public boolean isAttribute()
Returnstrueif this reference was an attribute of some other node.
-
markAsAttribute
public void markAsAttribute()
-
isString
public boolean isString()
-
markAsString
public void markAsString()
-
isCall
public boolean isCall()
Returnstrueif this reference is a function or method call.
-
markAsCall
public void markAsCall()
Returnstrueif this reference is a class instantiation.
-
isNew
public boolean isNew()
-
markAsNew
public void markAsNew()
-
isRef
public boolean isRef()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG