org.basex.query.item
Class Nod

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
Direct Known Subclasses:
DBNode, FNode

public abstract class Nod
extends Item

Node type.

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
 
Fields inherited from class org.basex.query.item.Item
score, type
 
Method Summary
 NodeIter anc()
          Returns an ancestor axis iterator.
 NodeIter ancOrSelf()
          Returns an ancestor-or-self axis iterator.
abstract  NodeIter attr()
          Returns an attribute axis iterator.
 byte[] base()
          Returns the database name.
 boolean bool()
          Returns a boolean representation of the item.
abstract  NodeMore child()
          Returns a child axis iterator.
abstract  Nod copy()
          Creates a new copy (clone) of the node.
 double dbl()
          Returns a double representation of the item.
 BigDecimal dec()
          Returns a decimal representation of the item.
abstract  NodeIter desc()
          Returns a descendant axis iterator.
abstract  NodeIter descOrSelf()
          Returns a descendant-or-self axis iterator.
 int diff(Item i)
          Returns the difference between the current and the specified item.
abstract  int diff(Nod nod)
          Compares two nodes for their unique order.
 boolean eq(Item i)
          Checks the items for equality.
 Nod finish()
          Returns a final node representation.
 float flt()
          Returns a float representation of the item.
 NodeIter foll()
          Returns a following axis iterator.
 NodeIter follSibl()
          Returns a following-sibling axis iterator.
 int id()
          Returns the node id.
abstract  boolean is(Nod nod)
          Compares two nodes for equality.
 long itr()
          Returns an integer (long) representation of the item.
 BXNode java()
          Returns a Java object.
static int kind(Type t)
          Returns a database kind for the specified node type.
 byte[] nname()
          Returns the node name.
 Atts ns()
          Returns a namespace array.
abstract  NodeIter par()
          Returns a parent axis iterator.
abstract  Nod parent()
          Returns the parent node.
 void parent(Nod p)
          Sets the parent node.
 NodeIter prec()
          Returns a preceding axis iterator.
 NodeIter precSibl()
          Returns a preceding-sibling axis iterator.
 QNm qname()
          Returns the node name.
 QNm qname(QNm nm)
          Returns a temporary node name.
 NodeMore self()
          Returns an self axis iterator.
 byte[] uri(byte[] pref, QueryContext ctx)
          Returns the uri for the specified prefix.
 
Methods inherited from class org.basex.query.item.Item
atomic, comp, d, duplicates, ebv, hashCode, i, iter, iter, n, name, node, plan, removable, returned, s, score, score, serialize, size, str, test, toString, 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
color, info
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

bool

public final boolean bool()
Description copied from class: Item
Returns a boolean representation of the item.

Overrides:
bool in class Item
Returns:
boolean value

itr

public final long itr()
               throws QueryException
Description copied from class: Item
Returns an integer (long) representation of the item.

Overrides:
itr in class Item
Returns:
long value
Throws:
QueryException - query exception

flt

public final float flt()
                throws QueryException
Description copied from class: Item
Returns a float representation of the item.

Overrides:
flt in class Item
Returns:
float value
Throws:
QueryException - query exception

dec

public final BigDecimal dec()
                     throws QueryException
Description copied from class: Item
Returns a decimal representation of the item.

Overrides:
dec in class Item
Returns:
decimal value
Throws:
QueryException - query exception

dbl

public final double dbl()
                 throws QueryException
Description copied from class: Item
Returns a double representation of the item.

Overrides:
dbl in class Item
Returns:
double value
Throws:
QueryException - query exception

eq

public final boolean eq(Item i)
                 throws QueryException
Description copied from class: Item
Checks the items for equality.

Specified by:
eq in class Item
Parameters:
i - item to be compared
Returns:
result of check
Throws:
QueryException - query exception

diff

public final int diff(Item i)
               throws QueryException
Description copied from class: Item
Returns the difference between the current and the specified item.

Overrides:
diff in class Item
Parameters:
i - item to be compared
Returns:
difference
Throws:
QueryException - query exception

copy

public abstract Nod copy()
Creates a new copy (clone) of the node.

Returns:
new copy

nname

public byte[] nname()
Returns the node name.

Returns:
name

qname

public QNm qname()
Returns the node name.

Returns:
name

id

public final int id()
Returns the node id.

Returns:
id

qname

public QNm qname(QNm nm)
          throws QueryException
Returns a temporary node name.

Parameters:
nm - temporary qname
Returns:
name
Throws:
QueryException - query exception

ns

public Atts ns()
Returns a namespace array.

Returns:
namespace array

uri

public byte[] uri(byte[] pref,
                  QueryContext ctx)
Returns the uri for the specified prefix.

Parameters:
pref - prefix
ctx - query context
Returns:
uri

base

public byte[] base()
Returns the database name.

Returns:
database name

is

public abstract boolean is(Nod nod)
Compares two nodes for equality.

Parameters:
nod - node to be compared
Returns:
result of check

diff

public abstract int diff(Nod nod)
Compares two nodes for their unique order.

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

finish

public Nod finish()
Returns a final node representation. This method should be called as soon as a node is passed on as result node.

Returns:
node

parent

public abstract Nod parent()
Returns the parent node.

Returns:
parent node

parent

public void parent(Nod p)
Sets the parent node.

Parameters:
p - parent node

anc

public NodeIter anc()
Returns an ancestor axis iterator.

Returns:
iterator

ancOrSelf

public final NodeIter ancOrSelf()
Returns an ancestor-or-self axis iterator.

Returns:
iterator

attr

public abstract NodeIter attr()
Returns an attribute axis iterator.

Returns:
iterator

child

public abstract NodeMore child()
Returns a child axis iterator.

Returns:
iterator

desc

public abstract NodeIter desc()
Returns a descendant axis iterator.

Returns:
iterator

descOrSelf

public abstract NodeIter descOrSelf()
Returns a descendant-or-self axis iterator.

Returns:
iterator

foll

public final NodeIter foll()
Returns a following axis iterator.

Returns:
iterator

follSibl

public final NodeIter follSibl()
Returns a following-sibling axis iterator.

Returns:
iterator

par

public abstract NodeIter par()
Returns a parent axis iterator.

Returns:
iterator

prec

public final NodeIter prec()
Returns a preceding axis iterator.

Returns:
iterator

precSibl

public final NodeIter precSibl()
Returns a preceding-sibling axis iterator.

Returns:
iterator

self

public final NodeMore self()
Returns an self axis iterator.

Returns:
iterator

kind

public static int kind(Type t)
Returns a database kind for the specified node type.

Parameters:
t - node type
Returns:
node kind

java

public final BXNode java()
Description copied from class: Item
Returns a Java object.

Overrides:
java in class Item
Returns:
string representation