org.python.indexer.ast
Class NQname
- java.lang.Object
-
- org.python.indexer.ast.NNode
-
- org.python.indexer.ast.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 toNAttribute, but handles leading dots and other import-specific special cases.Qualified names with leading dots are given
NQnameelements for each leading dot. Dots separating simple names are not givenNQnameelements.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description NQname(NQname next, NName name)NQname(NQname next, NName name, int start, int end)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description NQnamegetBottom()Returns the last/bottom component of the chain.NNamegetName()Returns this component of the qname chain.NQnamegetNext()Returns the next component of the chain, ornullif this is the last component.NQnamegetPrevious()Returns the previous component of this qname chain, ornullif this is the first component.NQnamegetTop()Returns the top (first) component in the chain.booleanisBottom()Returnstrueif this is the last/bottom component of the chain, or if the name is unqualified (i.e.booleanisDot()Returnstrueif this qname component is a leading dot.booleanisTop()Returnstrueif this is the first/top component of the chain, or if the name is unqualified (i.e.booleanisUnqualified()Returnstrueif this qname represents a simple, non-dotted module name such as "os", "random" or "foo".NTyperesolve(Scope s)Resolves and loads the module named by this qname.java.lang.StringthisQname()Returns the qname down to (and including) this component, ending with this component's name.java.lang.StringtoQname()Joins all components in this qname chain, beginning with the current component.java.lang.StringtoString()voidvisit(NNodeVisitor v)Visits this node and optionally its children.-
Methods inherited from class org.python.indexer.ast.NNode
addChildren, addChildren, addType, bindsName, end, getAstRoot, getDeepestNodeAtOffset, getEnclosingNamespace, getFile, getParent, getTable, getType, isCall, isClassDef, isFunctionDef, isLambda, isModule, isName, length, resolveExpr, setEnd, setParent, setStart, setType, start
-
-
-
-
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, ornullif this is the first component.
-
getNext
public NQname getNext()
Returns the next component of the chain, ornullif this is the last component.
-
getBottom
public NQname getBottom()
Returns the last/bottom component of the chain.
-
isTop
public boolean isTop()
Returnstrueif 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()
Returnstrueif 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()
Returnstrueif 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 thisNQnameinstance represents thefooinorg.foo.bar, this method will returnorg.foo.
-
getTop
public NQname getTop()
Returns the top (first) component in the chain.
-
isDot
public boolean isDot()
Returnstrueif 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.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
visit
public void visit(NNodeVisitor v)
Description copied from class:NNodeVisits this node and optionally its children.
-
-
DMelt 3.0 © DataMelt by jWork.ORG