org.basex.query.xpath.item
Class Nod

java.lang.Object
  extended by org.basex.query.ExprInfo
      extended by org.basex.query.xpath.expr.Expr
          extended by org.basex.query.xpath.item.Item
              extended by org.basex.query.xpath.item.Nod
All Implemented Interfaces:
Result

public final class Nod
extends Item

XPath Value representing a NodeSet.

Author:
Workgroup DBIS, University of Konstanz 2005-08, ISC License, Tim Petrowsky

Field Summary
 int currPos
          Current node set position.
 int currSize
          Current node set size.
 Data data
          Data reference..
 int[] nodes
          Node array.
 int size
          Number of stored values..
 
Constructor Summary
Nod(Data d)
          Constructor, creating a new node set from the specified node ids.
Nod(int[] ids, Data d)
          Constructor, creating a new node set from the specified node ids.
Nod(int[] ids, XPContext ctx)
          Constructor, creating a new node set from the specified node ids.
Nod(XPContext ctx)
          Constructor, creating an empty node set.
 
Method Summary
 boolean appr(Item v)
          Checks the approximate equality of the value and the specified value.
 boolean apprContainedIn(Item val)
          inverse contains (this NodeSet is the argument to val.apprContains).
 boolean apprContains(Item v)
          Checks whether this value approximately contains the word(s) in val.
 boolean bool()
          Returns the boolean value.
 boolean eq(Item v)
          Checks the equality of the value and the specified value.
 Nod eval(XPContext ctx)
          Evaluates the expression with the specified context set.
 boolean ge(Item v)
          Checks if the value is greater than or equal to the specified value.
 boolean gt(Item v)
          Checks if the value is greater than the specified value.
 boolean le(Item v)
          Checks if the value is less than or equal to the specified value.
 boolean lt(Item v)
          Checks if the value is less than the specified value.
 double num()
          Returns the double value.
 void plan(Serializer ser)
          Recursively sends the abstract syntax of this expression to the specified serializer.
 int prec()
          Returns the evaluation precedence.
 void serialize(Serializer ser)
          Serializes the complete result.
 void serialize(Serializer ser, int n)
          Serializes the specified result.
 void set(int pre)
          Sets a single node.
 int size()
          Number of values, stored in the result instance.
 byte[] str()
          Returns the literal value.
 java.lang.String toString()
           
 
Methods inherited from class org.basex.query.xpath.item.Item
comp, same, usesPos, usesSize
 
Methods inherited from class org.basex.query.xpath.expr.Expr
indexEquivalent, indexSizes, returnedValue, sameAs
 
Methods inherited from class org.basex.query.ExprInfo
color, info, name
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nodes

public int[] nodes
Node array.


data

public Data data
Data reference..


size

public int size
Number of stored values..


currPos

public int currPos
Current node set position.


currSize

public int currSize
Current node set size.

Constructor Detail

Nod

public Nod(int[] ids,
           XPContext ctx)
Constructor, creating a new node set from the specified node ids.

Parameters:
ids - node ids
ctx - query context

Nod

public Nod(XPContext ctx)
Constructor, creating an empty node set.

Parameters:
ctx - query context

Nod

public Nod(Data d)
Constructor, creating a new node set from the specified node ids.

Parameters:
d - data reference

Nod

public Nod(int[] ids,
           Data d)
Constructor, creating a new node set from the specified node ids.

Parameters:
ids - node ids
d - data reference
Method Detail

set

public void set(int pre)
Sets a single node.

Parameters:
pre - node to be set.

size

public int size()
Description copied from class: Item
Number of values, stored in the result instance.

Specified by:
size in interface Result
Overrides:
size in class Item
Returns:
number of values

serialize

public void serialize(Serializer ser)
               throws java.io.IOException
Description copied from class: Item
Serializes the complete result.

Specified by:
serialize in interface Result
Overrides:
serialize in class Item
Parameters:
ser - serializer
Throws:
java.io.IOException - exception

serialize

public void serialize(Serializer ser,
                      int n)
               throws java.io.IOException
Description copied from class: Item
Serializes the specified result.

Specified by:
serialize in interface Result
Overrides:
serialize in class Item
Parameters:
ser - serializer
n - number of result to serialize
Throws:
java.io.IOException - exception

eval

public Nod eval(XPContext ctx)
Description copied from class: Expr
Evaluates the expression with the specified context set. Additionally provides a context

Specified by:
eval in class Expr
Parameters:
ctx - query context
Returns:
resulting XPathValue

bool

public boolean bool()
Description copied from class: Item
Returns the boolean value.

Specified by:
bool in class Item
Returns:
boolean value

str

public byte[] str()
Description copied from class: Item
Returns the literal value.

Specified by:
str in class Item
Returns:
literal value

num

public double num()
Description copied from class: Item
Returns the double value.

Specified by:
num in class Item
Returns:
double value

prec

public int prec()
Description copied from class: Item
Returns the evaluation precedence.

Returns:
evaluation precedence

lt

public boolean lt(Item v)
Description copied from class: Item
Checks if the value is less than the specified value.

Parameters:
v - value to be compared
Returns:
result of comparison.

le

public boolean le(Item v)
Description copied from class: Item
Checks if the value is less than or equal to the specified value.

Parameters:
v - value to be compared
Returns:
result of comparison.

gt

public boolean gt(Item v)
Description copied from class: Item
Checks if the value is greater than the specified value.

Parameters:
v - value to be compared
Returns:
result of comparison.

ge

public boolean ge(Item v)
Description copied from class: Item
Checks if the value is greater than or equal to the specified value.

Parameters:
v - value to be compared
Returns:
result of comparison.

eq

public boolean eq(Item v)
Description copied from class: Item
Checks the equality of the value and the specified value.

Specified by:
eq in class Item
Parameters:
v - value to be compared
Returns:
result of comparison.

appr

public boolean appr(Item v)
Description copied from class: Item
Checks the approximate equality of the value and the specified value.

Parameters:
v - value to be compared
Returns:
result of comparison.

apprContains

public boolean apprContains(Item v)
Description copied from class: Item
Checks whether this value approximately contains the word(s) in val.

Parameters:
v - value to be compared
Returns:
result of comparison.

apprContainedIn

public boolean apprContainedIn(Item val)
inverse contains (this NodeSet is the argument to val.apprContains).

Parameters:
val - value to contain one of these nodes
Returns:
whether val contains one of the node-values in this set

toString

public java.lang.String toString()
Specified by:
toString in class Item

plan

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

Specified by:
plan in class ExprInfo
Parameters:
ser - serializer
Throws:
java.io.IOException - exception