Package org.basex.query.value.node
Class FElem
Element node fragment.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionFElem(byte[] name) Convenience constructor for creating an element.FElem(byte[] local, byte[] uri) Convenience constructor for creating an element with a new namespace.FElem(byte[] prefix, byte[] local, byte[] uri) Convenience constructor for creating an element with a new namespace.Convenience constructor for creating an element.Convenience constructor for creating an element with a new namespace.Convenience constructor for creating an element with a new namespace.Constructor for creating an element.Constructor for creating an element with nodes, attributes and namespace declarations.Constructor for creating an element from a DOM node. -
Method Summary
Modifier and TypeMethodDescriptionadd(byte[] text) Creates and adds a text node if the specified value is not empty.add(byte[] nm, byte[] val) Adds an attribute and updates its parent reference.Adds an attribute and updates its parent reference.Creates and adds a text node if the specified value is not empty.Adds an attribute and updates its parent reference.Adds an attribute and updates its parent reference.Adds an attribute and updates its parent reference.Adds an attribute and updates its parent reference.Adds a node and updates its parent reference.Returns a light-weight, low-level attribute axis iterator withIter.size()andIter.get(long)implemented.byte[]baseURI()Returns the base URI of the node.Returns a light-weight, low-level child axis iterator.Adds a namespace declaration for the QName of this element.booleanThis function is e.g.booleanIndicates if the node has children.materialize(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.optimize()Minimizes the memory consumption of the node.voidCreates a query plan.voidplan(QueryString qs) Creates a query string.qname()Returns the QName (optional prefix, local name) of an attribute, element or processing instruction.byte[]string()Returns the string value.Methods inherited from class org.basex.query.value.node.FNode
descendantIter, descendantOrSelfIter, diff, finish, hashCode, is, parent, parent, toJavaMethods inherited from class org.basex.query.value.node.ANode
ancestorIter, ancestorOrSelfIter, atomItem, atomItem, atomValue, attribute, attribute, bool, comparable, copy, copy, ddo, diff, eq, followingIter, followingSiblingIter, kind, kind, nodeType, nsScope, parentIter, precedingIter, precedingSiblingIter, root, sameKey, selfIter, string, type, uriMethods 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, 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, funcType, hasFreeVars, indexAccessible, isSimple, markTailCalls, mergeEbv, optimize, simplifyFor, typeCheck, uses, vacuous, visitAllMethods inherited from class org.basex.query.expr.ExprInfo
toErrorString, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
FElem
Convenience constructor for creating an element.- Parameters:
name- element name
-
FElem
public FElem(byte[] name) Convenience constructor for creating an element.- Parameters:
name- element name
-
FElem
public FElem(byte[] local, byte[] uri) Convenience constructor for creating an element with a new namespace.- Parameters:
local- local nameuri- namespace uri
-
FElem
Convenience constructor for creating an element with a new namespace.- Parameters:
local- local nameuri- namespace uri
-
FElem
Convenience constructor for creating an element with a new namespace.- Parameters:
prefix- prefix (a default namespace will be created if the string is empty)local- local nameuri- namespace uri
-
FElem
public FElem(byte[] prefix, byte[] local, byte[] uri) Convenience constructor for creating an element with a new namespace.- Parameters:
prefix- prefix (a default namespace will be created if the string is empty)local- local nameuri- namespace uri
-
FElem
Constructor for creating an element.- Parameters:
name- element name
-
FElem
Constructor for creating an element with nodes, attributes and namespace declarations.- Parameters:
name- element namens- namespaces, may benullchildren- children, may benullatts- attributes, may benull
-
FElem
Constructor for creating an element from a DOM node. Originally provided by Erdal Karaca.- Parameters:
elem- DOM nodeparent- parent reference (can benull)nss- namespaces in scope
-
-
Method Details
-
optimize
Description copied from class:ANodeMinimizes the memory consumption of the node. -
declareNS
Adds a namespace declaration for the QName of this element.- Returns:
- self reference
-
add
Adds a node and updates its parent reference.- Parameters:
node- node to be added- Returns:
- self reference
-
add
Adds an attribute and updates its parent reference.- Parameters:
nm- attribute nameval- attribute value- Returns:
- self reference
-
add
Adds an attribute and updates its parent reference.- Parameters:
nm- attribute nameval- attribute value- Returns:
- self reference
-
add
Adds an attribute and updates its parent reference.- Parameters:
nm- attribute nameval- attribute value- Returns:
- self reference
-
add
Adds an attribute and updates its parent reference.- Parameters:
nm- attribute nameval- attribute value- Returns:
- self reference
-
add
Adds an attribute and updates its parent reference.- Parameters:
nm- attribute nameval- attribute value- Returns:
- self reference
-
add
Adds an attribute and updates its parent reference.- Parameters:
nm- attribute nameval- attribute value- Returns:
- self reference
-
add
Creates and adds a text node if the specified value is not empty. Converts the specified string to a token and callsadd(byte[]).- Parameters:
text- value of text node- Returns:
- self reference
-
add
Creates and adds a text node if the specified value is not empty.- Parameters:
text- value of text node- Returns:
- self reference
-
namespaces
Description copied from class:ANode- Overrides:
namespacesin classANode- Returns:
- namespace array or
null
-
string
public byte[] string()Description copied from class:ANodeReturns the string value. -
baseURI
public byte[] baseURI()Description copied from class:ANodeReturns the base URI of the node. -
qname
Description copied from class:ANodeReturns the QName (optional prefix, local name) of an attribute, element or processing instruction. -
name
public byte[] name()Description copied from class:ANodeReturns the name (optional prefix, local name) of an attribute, element or processing instruction. This function is possibly evaluated faster thanANode.qname(), as noQNminstance may need to be created. -
attributeIter
Description copied from class:ANodeReturns 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 viaANode.finish().- Overrides:
attributeIterin classFNode- Returns:
- iterator
-
childIter
Description copied from class:ANodeReturns a light-weight, low-level child axis iterator. Before nodes are added to the result, they must be finalized viaANode.finish(). -
hasChildren
public boolean hasChildren()Description copied from class:ANodeIndicates if the node has children.- Overrides:
hasChildrenin classFNode- Returns:
- result of test
-
materialize
Description copied from class:ItemReturns a materialized, context-independent version of this item.- Specified by:
materializein classANode- Parameters:
qc- query context (ifnull, process cannot be interrupted)copy- create full copy- Returns:
- item copy, or
null) if the item cannot be materialized
-
equals
Description copied from class:ExprThis function is e.g. called by:If.optimize(CompileContext),Switch.optimize(CompileContext),Typeswitch.optimize(CompileContext), in order to discard identical expressions.CmpR.mergeEbv(Expr, boolean, CompileContext)orCmpSR.mergeEbv(Expr, boolean, CompileContext), in order to merge expressions with identical input.CmpG.optimize(CompileContext)orCmpV.optimize(CompileContext), in order to pre-evaluate equality tests.CmpG.optimize(CompileContext)orPos.get(Expr, CmpV.OpV, InputInfo, CompileContext), in order to compare the start and end value.PathCache, in order to find identical root values at runtime.
-
plan
Description copied from class:ExprInfoCreates a query plan. -
plan
Description copied from class:ExprInfoCreates a query string.
-