org.basex.query.item
Class DBNode

java.lang.Object
  extended by org.basex.query.ExprInfo
      extended by org.basex.query.expr.Expr
          extended by org.basex.query.item.Item
              extended by org.basex.query.item.Nod
                  extended by org.basex.query.item.DBNode
Direct Known Subclasses:
FTItem

public class DBNode
extends Nod

Disk-based Node item.

Author:
Workgroup DBIS, University of Konstanz 2005-10, ISC License, Christian Gruen

Nested Class Summary
 
Nested classes/interfaces inherited from class org.basex.query.expr.Expr
Expr.Use
 
Field Summary
 Data data
          Data reference.
 int pre
          Pre value.
 Nod root
          Root node (constructor).
static Type[] TYPES
          Node Types.
 
Fields inherited from class org.basex.query.item.Item
score, type
 
Constructor Summary
DBNode()
          Constructor.
DBNode(Data d, int p)
          Constructor.
DBNode(Data d, int p, int k)
          Constructor.
DBNode(Data d, int p, Nod r, Type t)
          Constructor.
 
Method Summary
 NodeIter anc()
          Returns an ancestor axis iterator.
 NodeIter attr()
          Returns an attribute axis iterator.
 byte[] base()
          Returns the database name.
 NodeMore child()
          Returns a child axis iterator.
 String color()
          Returns a color string for the expression.
 DBNode copy()
          Creates a new copy (clone) of the node.
 NodeIter desc()
          Returns a descendant axis iterator.
 NodeIter descOrSelf()
          Returns a descendant-or-self axis iterator.
 int diff(Nod nod)
          Compares two nodes for their unique order.
 DBNode finish()
          Returns a final node representation.
 boolean is(Nod nod)
          Compares two nodes for equality.
 byte[] nname()
          Returns the node name.
 Atts ns()
          Returns a namespace array.
 NodeIter par()
          Returns a parent axis iterator.
 Nod parent()
          Returns the parent node.
 void parent(Nod p)
          Sets the parent node.
 void plan(Serializer ser)
          Recursively sends the abstract syntax of this expression to the specified serializer.
 QNm qname()
          Returns the node name.
 QNm qname(QNm name)
          Returns a temporary node name.
 void serialize(Serializer ser)
          Serializes the item.
 void set(int p, int k)
          Sets the node type.
 byte[] str()
          Returns an atomized string.
 String toString()
           
 
Methods inherited from class org.basex.query.item.Nod
ancOrSelf, bool, dbl, dec, diff, eq, flt, foll, follSibl, id, itr, java, kind, prec, precSibl, self, uri
 
Methods inherited from class org.basex.query.item.Item
atomic, comp, d, duplicates, ebv, hashCode, i, iter, iter, n, name, node, removable, returned, s, score, score, size, test, u, uses
 
Methods inherited from class org.basex.query.expr.Expr
addText, checkCtx, checkDbl, checkItr, e, indexAccessible, indexEquivalent, remove, sameAs, v
 
Methods inherited from class org.basex.query.ExprInfo
info
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPES

public static final Type[] TYPES
Node Types.


data

public final Data data
Data reference.


root

public Nod root
Root node (constructor).


pre

public int pre
Pre value.

Constructor Detail

DBNode

public DBNode()
Constructor.


DBNode

public DBNode(Data d,
              int p)
Constructor.

Parameters:
d - data reference
p - pre value

DBNode

public DBNode(Data d,
              int p,
              int k)
Constructor.

Parameters:
d - data reference
p - pre value
k - node kind

DBNode

public DBNode(Data d,
              int p,
              Nod r,
              Type t)
Constructor.

Parameters:
d - data reference
p - pre value
r - parent reference
t - node type
Method Detail

set

public final void set(int p,
                      int k)
Sets the node type.

Parameters:
p - pre value
k - node kind

str

public final byte[] str()
Description copied from class: Item
Returns an atomized string.

Overrides:
str in class Item
Returns:
string representation

serialize

public final void serialize(Serializer ser)
                     throws IOException
Description copied from class: Item
Serializes the item.

Overrides:
serialize in class Item
Parameters:
ser - serializer
Throws:
IOException - I/O exception

nname

public final byte[] nname()
Description copied from class: Nod
Returns the node name.

Overrides:
nname in class Nod
Returns:
name

qname

public final QNm qname()
Description copied from class: Nod
Returns the node name.

Overrides:
qname in class Nod
Returns:
name

qname

public final QNm qname(QNm name)
Description copied from class: Nod
Returns a temporary node name.

Overrides:
qname in class Nod
Parameters:
name - temporary qname
Returns:
name

ns

public final Atts ns()
Description copied from class: Nod
Returns a namespace array.

Overrides:
ns in class Nod
Returns:
namespace array

base

public final byte[] base()
Description copied from class: Nod
Returns the database name.

Overrides:
base in class Nod
Returns:
database name

is

public final boolean is(Nod nod)
Description copied from class: Nod
Compares two nodes for equality.

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

diff

public final int diff(Nod nod)
Description copied from class: Nod
Compares two nodes for their unique order.

Specified by:
diff in class Nod
Parameters:
nod - node to be compared
Returns:
0 if the nodes are equal or a positive/negative value if the node appears after/before the argument

copy

public final DBNode copy()
Description copied from class: Nod
Creates a new copy (clone) of the node.

Specified by:
copy in class Nod
Returns:
new copy

finish

public final DBNode finish()
Description copied from class: Nod
Returns a final node representation. This method should be called as soon as a node is passed on as result node.

Overrides:
finish in class Nod
Returns:
node

parent

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

Specified by:
parent in class Nod
Returns:
parent node

parent

public final void parent(Nod p)
Description copied from class: Nod
Sets the parent node.

Overrides:
parent in class Nod
Parameters:
p - parent node

anc

public final NodeIter anc()
Description copied from class: Nod
Returns an ancestor axis iterator.

Overrides:
anc in class Nod
Returns:
iterator

attr

public final NodeIter attr()
Description copied from class: Nod
Returns an attribute axis iterator.

Specified by:
attr in class Nod
Returns:
iterator

child

public final NodeMore child()
Description copied from class: Nod
Returns a child axis iterator.

Specified by:
child in class Nod
Returns:
iterator

desc

public final NodeIter desc()
Description copied from class: Nod
Returns a descendant axis iterator.

Specified by:
desc in class Nod
Returns:
iterator

descOrSelf

public final NodeIter descOrSelf()
Description copied from class: Nod
Returns a descendant-or-self axis iterator.

Specified by:
descOrSelf in class Nod
Returns:
iterator

par

public final NodeIter par()
Description copied from class: Nod
Returns a parent axis iterator.

Specified by:
par in class Nod
Returns:
iterator

color

public final String color()
Description copied from class: ExprInfo
Returns a color string for the expression.

Overrides:
color in class ExprInfo
Returns:
color

plan

public final void plan(Serializer ser)
                throws IOException
Description copied from class: ExprInfo
Recursively sends the abstract syntax of this expression to the specified serializer.

Overrides:
plan in class Item
Parameters:
ser - serializer
Throws:
IOException - I/O exception

toString

public String toString()
Overrides:
toString in class Item