org.basex.query.xpath.values
Class NodeSet

java.lang.Object
  extended by org.basex.query.xpath.expr.Expr
      extended by org.basex.query.xpath.values.Item
          extended by org.basex.query.xpath.values.NodeSet
All Implemented Interfaces:
Result

public final class NodeSet
extends Item

XPath Value representing a NodeSet.

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

Field Summary
 int currPos
          Current nodeset position.
 int currSize
          Current nodeset size.
 Data data
          Data reference..
 int[][] ftidpos
          FTIdPos array.
 int[] ftids
          FTIds array.
 int mCount
          Count maximal number of pre-values.
 int[] nodes
          Node array.
 int size
          Number of stored values..
 
Constructor Summary
NodeSet(Data d)
          Constructor, creating a new node set from the specified node ids.
NodeSet(int[] ids, Data d)
          Constructor, creating a new node set from the specified node ids.
NodeSet(int[] ids, XPContext ctx)
          Constructor, creating a new node set from the specified node ids.
NodeSet(int[] ids, XPContext ctx, int[][] ftIds)
          Constructor, creating a new node set from the specified node ids.
NodeSet(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 ftcontains (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 contains(Item val)
          Checks whether this value contains the word(s) in val.
 boolean eq(Item v)
          Checks the equality of the value and the specified value.
 NodeSet eval(XPContext ctx)
          Evaluates the expression with the specified context set.
 boolean ftcontainedin(Item val)
          inverse ftcontains (this NodeSet is the argument to val.ftcontains).
 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.
 int prec()
          Returns the evaluation precedence.
 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.values.Item
compile, sameAs, serialize, serialize, usesPos, usesSize
 
Methods inherited from class org.basex.query.xpath.expr.Expr
indexEquivalent, indexSizes, returnedValue, sameAs
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

currPos

public int currPos
Current nodeset position.


currSize

public int currSize
Current nodeset size.


data

public Data data
Data reference..


ftidpos

public int[][] ftidpos
FTIdPos array.


ftids

public int[] ftids
FTIds array.


mCount

public int mCount
Count maximal number of pre-values.


nodes

public int[] nodes
Node array.


size

public int size
Number of stored values..

Constructor Detail

NodeSet

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

Parameters:
d - data reference

NodeSet

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

Parameters:
ids - node ids
d - data reference

NodeSet

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

Parameters:
ids - node ids
ctx - query context

NodeSet

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

Parameters:
ids - node ids
ctx - query context
ftIds - ids and posvalues for fulltextqueries

NodeSet

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

Parameters:
ctx - query context
Method Detail

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.

apprContainedIn

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

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

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.

bool

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

Specified by:
bool in class Item
Returns:
boolean value

contains

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

Parameters:
val - word(s) to be contained
Returns:
whether val is contained

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.

eval

public NodeSet 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

ftcontainedin

public boolean ftcontainedin(Item val)
inverse ftcontains (this NodeSet is the argument to val.ftcontains).

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

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.

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.

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.

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.

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

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

str

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

Specified by:
str in class Item
Returns:
literal value

toString

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