Package org.basex.query.value.node
Class ANode
java.lang.Object
org.basex.query.expr.ExprInfo
org.basex.query.expr.Expr
org.basex.query.value.Value
org.basex.query.value.item.Item
org.basex.query.value.node.ANode
Abstract node type.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns a light-weight, low-level ancestor axis iterator.Returns a light-weight ancestor-or-self axis iterator.atomItem()Returns an atomic item.final ItematomItem(QueryContext qc, InputInfo ii) Evaluates the expression and returns the resulting, atomized item, orEmpty.VALUEif the expression yields an empty sequence.final ItematomValue(QueryContext qc, InputInfo ii) Evaluates the expression and returns the atomized items.byte[]attribute(byte[] name) Returns the value of the specified attribute.byte[]Returns the value of the specified attribute.abstract BasicNodeIterReturns a light-weight, low-level attribute axis iterator withIter.size()andIter.get(long)implemented.byte[]baseURI()Returns the base URI of the node.final booleanReturns a boolean representation of the value.abstract BasicNodeIterReturns a light-weight, low-level child axis iterator.final booleancomparable(Item item) Checks if the items can be compared.final DBNodecopy(MainOptions options, QueryContext qc) Creates a database node copy from this node.final DBNodecopy(QueryContext qc) Creates a database node copy from this node.booleanddo()Indicates if this expression returns nodes in document order without duplicates.abstract BasicNodeIterReturns a light-weight, low-level descendant axis iterator.abstract BasicNodeIterReturns a light-weight, low-level descendant-or-self axis iterator.final intReturns the difference between the current and the specified item.abstract intChecks the document order of two nodes.final booleaneq(Item item, Collation coll, StaticContext sc, InputInfo ii) Compares the items for equality.abstract ANodefinish()Returns a finalized node instance.Returns a light-weight, low-level following axis iterator.Returns a light-weight, low-level following-sibling axis iterator.abstract booleanIndicates if the node has children.abstract booleanChecks if two nodes are identical.intkind()Returns a database kind for the specified node type.static intReturns a database kind for the specified node type.abstract ANodematerialize(QueryContext qc, boolean copy) Returns a materialized, context-independent version of this item.byte[]name()Returns the name (optional prefix, local name) of an attribute, element or processing instruction.Returns all namespaces defined for the nodes.final NodeTypenodeType()Returns this Node's node type.final AttsnsScope(StaticContext sc) Returns a copy of the namespace hierarchy.optimize()Minimizes the memory consumption of the node.abstract ANodeparent()Returns the parent node.abstract voidSets the parent node.final BasicNodeIterReturns a light-weight, low-level parent axis iterator.final BasicNodeIterReturns a light-weight, low-level preceding axis iterator.final BasicNodeIterReturns a light-weight, low-level preceding-sibling axis iterator.qname()Returns the QName (optional prefix, local name) of an attribute, element or processing instruction.final ANoderoot()Returns the root of a node (the topmost ancestor without parent node).booleanCompares the items for equality.final BasicNodeIterselfIter()Returns a self axis iterator.abstract byte[]string()Returns the string value.final byte[]Returns a string representation of the value.abstract BXNodetoJava()Returns a Java representation of the value.static NodeTypetype(int k) Returns a node type for the specified database kind.final byte[]uri(byte[] pref) Recursively finds the uri for the specified prefix.Methods inherited from class org.basex.query.value.item.Item
atomSize, cache, dbl, dec, description, ebv, equiv, flt, hash, input, instanceOf, item, itemAt, iter, itr, persistent, plan, refineType, reverse, score, seqType, size, subsequence, test, typeId, xdmInfoMethods inherited from class org.basex.query.value.Value
accept, checkUp, compile, copy, count, exprSize, has, inline, inlineable, isEmpty, isItem, iter, iterator, materialize, serialize, serialize, serialize, valueMethods inherited from class org.basex.query.expr.Expr
arg, args, atomIter, data, data, equals, funcType, hasFreeVars, indexAccessible, isSimple, markTailCalls, mergeEbv, optimize, simplifyFor, typeCheck, uses, vacuous, visitAllMethods inherited from class org.basex.query.expr.ExprInfo
plan, toErrorString, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
id
public final int idUnique node id. ID can get negative, as subtraction of ids is used for all comparisons.
-
-
Method Details
-
bool
Description copied from class:ItemReturns a boolean representation of the value. -
string
Description copied from class:ItemReturns a string representation of the value. -
string
public abstract byte[] string()Returns the string value.- Returns:
- string value
-
comparable
Description copied from class:ItemChecks if the items can be compared.- Overrides:
comparablein classItem- Parameters:
item- item to be compared- Returns:
- result of check
-
eq
public final boolean eq(Item item, Collation coll, StaticContext sc, InputInfo ii) throws QueryException Description copied from class:ItemCompares the items for equality.- Specified by:
eqin classItem- Parameters:
item- item to be comparedcoll- collation (can benull)sc- static context; required for comparing items of type xs:QName (can benull)ii- input info (can benull)- Returns:
- result of check
- Throws:
QueryException- query exception
-
sameKey
Description copied from class:ItemCompares the items for equality.- Overrides:
sameKeyin classItem- Parameters:
item- item to be comparedii- input info (can benull)- Returns:
- result of check
- Throws:
QueryException- query exception
-
diff
Description copied from class:ItemReturns the difference between the current and the specified item. This function is overwritten by the corresponding implementations.- Overrides:
diffin classItem- Parameters:
item- item to be comparedcoll- collation (can benull)ii- input info (can benull)- Returns:
- difference
- Throws:
QueryException- query exception
-
atomValue
Description copied from class:Item -
atomItem
Description copied from class:ItemEvaluates the expression and returns the resulting, atomized item, orEmpty.VALUEif the expression yields an empty sequence. Overwritten byXQArray,FuncItemandANode.- Overrides:
atomItemin classItem- Parameters:
qc- query contextii- input info (only required bySeqinstances, which have no input info)- Returns:
- item or
Empty.VALUE
-
atomItem
Returns an atomic item.- Returns:
- item
-
ddo
public boolean ddo()Description copied from class:ExprIndicates if this expression returns nodes in document order without duplicates. -
materialize
Description copied from class:ItemReturns a materialized, context-independent version of this item.- Overrides:
materializein classItem- Parameters:
qc- query context (ifnull, process cannot be interrupted)copy- create full copy- Returns:
- item copy, or
null) if the item cannot be materialized
-
copy
Creates a database node copy from this node.- Parameters:
qc- query context- Returns:
- database node
-
copy
Creates a database node copy from this node.- Parameters:
options- main optionsqc- query context (can benull; if supplied, allows interruption of process)- Returns:
- database node
-
finish
Returns a finalized node instance. This method is called when iterating through node results: If a single node instances is recycled, it needs to be duplicated in the final step.- Returns:
- node
-
name
public byte[] name()Returns the name (optional prefix, local name) of an attribute, element or processing instruction. This function is possibly evaluated faster thanqname(), as noQNminstance may need to be created.- Returns:
- name, or
nullif node has no name
-
qname
Returns the QName (optional prefix, local name) of an attribute, element or processing instruction.- Returns:
- name, or
nullif node has no QName
-
optimize
Minimizes the memory consumption of the node.- Returns:
- self reference
-
namespaces
- Returns:
- namespace array or
null
-
nsScope
Returns a copy of the namespace hierarchy.- Parameters:
sc- static context (can benull)- Returns:
- namespaces
-
uri
public final byte[] uri(byte[] pref) Recursively finds the uri for the specified prefix.- Parameters:
pref- prefix- Returns:
- uri or
null
-
baseURI
public byte[] baseURI()Returns the base URI of the node.- Returns:
- base URI
-
is
Checks if two nodes are identical.- Parameters:
node- node to be compared- Returns:
- result of check
-
diff
Checks the document order of two nodes.- Parameters:
node- node to be compared- Returns:
0if the nodes are identical, or1/-1if the node appears after/before the argument
-
root
Returns the root of a node (the topmost ancestor without parent node).- Returns:
- root node
-
parent
Returns the parent node.- Returns:
- parent node or
null
-
parent
Sets the parent node.- Parameters:
par- parent node
-
hasChildren
public abstract boolean hasChildren()Indicates if the node has children.- Returns:
- result of test
-
attribute
public byte[] attribute(byte[] name) Returns the value of the specified attribute.- Parameters:
name- attribute to be found- Returns:
- attribute value or
null
-
attribute
Returns the value of the specified attribute.- Parameters:
name- attribute to be found- Returns:
- attribute value or
null
-
ancestorIter
Returns a light-weight, low-level ancestor axis iterator. Before nodes are added to the result, they must be finalized viafinish(). Overwritten byDBNode.ancestorIter().- Returns:
- iterator
-
ancestorOrSelfIter
Returns a light-weight ancestor-or-self axis iterator. Before nodes are added to the result, they must be finalized viafinish(). Overwritten byDBNode.ancestorOrSelfIter().- Returns:
- iterator
-
attributeIter
Returns a light-weight, low-level attribute axis iterator withIter.size()andIter.get(long)implemented. Before nodes are added to the result, they must be finalized viafinish().- Returns:
- iterator
-
childIter
Returns a light-weight, low-level child axis iterator. Before nodes are added to the result, they must be finalized viafinish().- Returns:
- iterator
-
descendantIter
Returns a light-weight, low-level descendant axis iterator. Before nodes are added to the result, they must be finalized viafinish().- Returns:
- iterator
-
descendantOrSelfIter
Returns a light-weight, low-level descendant-or-self axis iterator. Before nodes are added to the result, they must be finalized viafinish().- Returns:
- iterator
-
followingIter
Returns a light-weight, low-level following axis iterator. Before nodes are added to the result, they must be finalized viafinish().- Returns:
- iterator
-
followingSiblingIter
Returns a light-weight, low-level following-sibling axis iterator. Before nodes are added to the result, they must be finalized viafinish().- Returns:
- iterator
-
parentIter
Returns a light-weight, low-level parent axis iterator. Before nodes are added to the result, they must be finalized viafinish().- Returns:
- iterator
-
precedingIter
Returns a light-weight, low-level preceding axis iterator. Before nodes are added to the result, they must be finalized viafinish().- Returns:
- iterator
-
precedingSiblingIter
Returns a light-weight, low-level preceding-sibling axis iterator. Before nodes are added to the result, they must be finalized viafinish().- Returns:
- iterator
-
selfIter
Returns a self axis iterator.- Returns:
- iterator
-
kind
public int kind()Returns a database kind for the specified node type.- Returns:
- node kind
-
kind
Returns a database kind for the specified node type.- Parameters:
type- node type- Returns:
- node kind, or
-1if no corresponding database kind exists
-
type
Returns a node type for the specified database kind.- Parameters:
k- database kind- Returns:
- node type
-
toJava
Description copied from class:ValueReturns a Java representation of the value. -
nodeType
Returns this Node's node type.- Returns:
- node type
-