Documentation of 'org.python.indexer.ast.NQname' Java class
NQname
org.python.indexer.ast

Class NQname

  • All Implemented Interfaces:
    java.io.Serializable


    public class NQname
    extends NNode
    Recursive doubly-linked list representation of a qualified module name, either absolute or relative. Similar to NAttribute, but handles leading dots and other import-specific special cases.

    Qualified names with leading dots are given NQname elements for each leading dot. Dots separating simple names are not given NQname elements.

    See Also:
    Serialized Form
    • Constructor Detail

      • NQname

        public NQname(NQname next,
                      NName name,
                      int start,
                      int end)
    • Method Detail

      • getName

        public NName getName()
        Returns this component of the qname chain.
      • getPrevious

        public NQname getPrevious()
        Returns the previous component of this qname chain, or null if this is the first component.
      • getNext

        public NQname getNext()
        Returns the next component of the chain, or null if this is the last component.
      • getBottom

        public NQname getBottom()
        Returns the last/bottom component of the chain.
      • isTop

        public boolean isTop()
        Returns true if this is the first/top component of the chain, or if the name is unqualified (i.e. has only one component, no dots).
      • isBottom

        public boolean isBottom()
        Returns true if this is the last/bottom component of the chain, or if the name is unqualified (i.e. has only one component, no dots).
      • isUnqualified

        public boolean isUnqualified()
        Returns true if this qname represents a simple, non-dotted module name such as "os", "random" or "foo".
      • toQname

        public java.lang.String toQname()
        Joins all components in this qname chain, beginning with the current component.
      • thisQname

        public java.lang.String thisQname()
        Returns the qname down to (and including) this component, ending with this component's name. For instance, if this NQname instance represents the foo in org.foo.bar, this method will return org.foo.
      • getTop

        public NQname getTop()
        Returns the top (first) component in the chain.
      • isDot

        public boolean isDot()
        Returns true if this qname component is a leading dot.
      • resolve

        public NType resolve(Scope s)
                      throws java.lang.Exception
        Resolves and loads the module named by this qname.
        Overrides:
        resolve in class NNode
        Returns:
        the module represented by the qname up to this point.
        Throws:
        java.lang.Exception
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • visit

        public void visit(NNodeVisitor v)
        Description copied from class: NNode
        Visits this node and optionally its children.

        Specified by:
        visit in class NNode
        Parameters:
        v - the object to call with this node. If the visitor returns true, the node also passes its children to the visitor.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.