Documentation of 'org.python.indexer.Ref' Java class
Ref
org.python.indexer

Class Ref



  • public class Ref
    extends java.lang.Object
    Encapsulates 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
      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() 
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • 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 reference
        offset - the 0-indexed file offset of the reference
        text - 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()
        Returns true if this reference was unquoted name.
      • isAttribute

        public boolean isAttribute()
        Returns true if this reference was an attribute of some other node.
      • markAsAttribute

        public void markAsAttribute()
      • isString

        public boolean isString()
        Returns true if this reference was a quoted name. If so, the start and length() include the positions of the opening and closing quotes, but isName() returns the text within the quotes.
      • markAsString

        public void markAsString()
      • isCall

        public boolean isCall()
        Returns true if this reference is a function or method call.
      • markAsCall

        public void markAsCall()
        Returns true if 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:
        toString in class java.lang.Object
      • equals

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.