org.basex.query.value.node
Class FNode

java.lang.Object
  extended by org.basex.data.ExprInfo
      extended by org.basex.query.expr.Expr
          extended by org.basex.query.value.Value
              extended by org.basex.query.value.item.Item
                  extended by org.basex.query.value.node.ANode
                      extended by org.basex.query.value.node.FNode
All Implemented Interfaces:
java.lang.Iterable<Item>
Direct Known Subclasses:
FAttr, FComm, FDoc, FElem, FNames, FPI, FTxt

public abstract class FNode
extends ANode

Main memory based node fragments.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Nested Class Summary
 
Nested classes/interfaces inherited from class org.basex.query.expr.Expr
Expr.Flag
 
Field Summary
 
Fields inherited from class org.basex.query.value.node.ANode
id
 
Fields inherited from class org.basex.query.value.item.Item
score, UNDEF
 
Fields inherited from class org.basex.query.value.Value
type
 
Method Summary
 AxisIter ancestor()
          Returns an ancestor axis iterator.
 AxisIter ancestorOrSelf()
          Returns an ancestor-or-self axis iterator.
 AxisMoreIter attributes()
          Returns an attribute axis iterator.
 AxisMoreIter children()
          Returns a child axis iterator.
 ANode deepCopy()
          Returns a deep copy of the node.
 AxisIter descendant()
          Returns a descendant axis iterator.
 AxisIter descendantOrSelf()
          Returns a descendant-or-self axis iterator.
 int diff(ANode node)
          Checks the document order of two nodes.
 AxisIter following()
          Returns a following axis iterator.
 AxisIter followingSibling()
          Returns a following-sibling axis iterator.
 boolean hasChildren()
          Returns true if the node has children.
 boolean is(ANode node)
          Checks if two nodes are identical.
 ANode parent()
          Returns the parent node.
 FNode parent(ANode p)
          Sets the parent node.
 AxisIter parentIter()
          Returns a parent axis iterator.
 QNm qname(QNm nm)
          Updates the specified with the information of the current node.
 byte[] string()
          Returns the string value.
 
Methods inherited from class org.basex.query.value.node.ANode
attribute, attribute, attribute, baseURI, bool, copy, dbCopy, diff, diff, eq, finish, kind, kind, name, namespaces, nodeType, nsScope, optimize, preceding, precedingSibling, qname, self, string, toJava, type, uri
 
Methods inherited from class org.basex.query.value.item.Item
castErr, comparable, dbl, dec, description, ebv, equiv, flt, hash, homogeneous, input, isItem, item, itemAt, iter, iterable, itr, materialize, plan, score, score, size, test, type, typeId, writeTo, xdmInfo
 
Methods inherited from class org.basex.query.value.Value
accept, cache, checkUp, compile, copy, count, data, exprSize, has, inline, isValue, iter, iterator, removable, serialize, value
 
Methods inherited from class org.basex.query.expr.Expr
addText, compEbv, copy, hasFreeVars, indexAccessible, indexEquivalent, inlineAll, isEmpty, isFunction, isVacuous, markTailCalls, optimize, sameAs, uses, visitAll
 
Methods inherited from class org.basex.data.ExprInfo
addPlan, addPlan, info, planAttr, planElem, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

string

public byte[] string()
Description copied from class: ANode
Returns the string value.

Specified by:
string in class ANode
Returns:
string value

qname

public final QNm qname(QNm nm)
Description copied from class: ANode
Updates the specified with the information of the current node. This is more efficient than calling ANode.qname(), as an existing QNm instance is reused. This function must only be called for elements, attributes and pi's.

Specified by:
qname in class ANode
Parameters:
nm - temporary qname
Returns:
name

deepCopy

public final ANode deepCopy()
Description copied from class: ANode
Returns a deep copy of the node.

Specified by:
deepCopy in class ANode
Returns:
node copy

is

public final boolean is(ANode node)
Description copied from class: ANode
Checks if two nodes are identical.

Specified by:
is in class ANode
Parameters:
node - node to be compared
Returns:
result of check

diff

public final int diff(ANode node)
Description copied from class: ANode
Checks the document order of two nodes.

Specified by:
diff in class ANode
Parameters:
node - node to be compared
Returns:
0 if the nodes are identical, or 1/-1 if the node appears after/before the argument

parent

public final ANode parent()
Description copied from class: ANode
Returns the parent node.

Specified by:
parent in class ANode
Returns:
parent node

ancestor

public final AxisIter ancestor()
Description copied from class: ANode
Returns an ancestor axis iterator.

Specified by:
ancestor in class ANode
Returns:
iterator

ancestorOrSelf

public final AxisIter ancestorOrSelf()
Description copied from class: ANode
Returns an ancestor-or-self axis iterator.

Specified by:
ancestorOrSelf in class ANode
Returns:
iterator

attributes

public AxisMoreIter attributes()
Description copied from class: ANode
Returns an attribute axis iterator.

Specified by:
attributes in class ANode
Returns:
iterator

children

public AxisMoreIter children()
Description copied from class: ANode
Returns a child axis iterator.

Specified by:
children in class ANode
Returns:
iterator

parent

public final FNode parent(ANode p)
Description copied from class: ANode
Sets the parent node.

Specified by:
parent in class ANode
Parameters:
p - parent node
Returns:
self reference

hasChildren

public boolean hasChildren()
Description copied from class: ANode
Returns true if the node has children.

Specified by:
hasChildren in class ANode
Returns:
result of test

descendant

public final AxisIter descendant()
Description copied from class: ANode
Returns a descendant axis iterator.

Specified by:
descendant in class ANode
Returns:
iterator

descendantOrSelf

public final AxisIter descendantOrSelf()
Description copied from class: ANode
Returns a descendant-or-self axis iterator.

Specified by:
descendantOrSelf in class ANode
Returns:
iterator

parentIter

public final AxisIter parentIter()
Description copied from class: ANode
Returns a parent axis iterator.

Specified by:
parentIter in class ANode
Returns:
iterator

followingSibling

public final AxisIter followingSibling()
Description copied from class: ANode
Returns a following-sibling axis iterator.

Specified by:
followingSibling in class ANode
Returns:
iterator

following

public final AxisIter following()
Description copied from class: ANode
Returns a following axis iterator.

Specified by:
following in class ANode
Returns:
iterator