org.basex.query.value.seq
Class DBNodeSeq

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.seq.Seq
                  extended by org.basex.query.value.seq.NativeSeq
                      extended by org.basex.query.value.seq.DBNodeSeq
All Implemented Interfaces:
java.lang.Iterable<Item>

public final class DBNodeSeq
extends NativeSeq

Sequence, containing at least two ordered database nodes.

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
 boolean complete
          Complete.
 int[] pres
          Pre values.
 
Fields inherited from class org.basex.query.value.Value
type
 
Method Summary
 Data data()
          Returns the data reference (if) attached to this value.
 Item ebv(QueryContext ctx, InputInfo ii)
          Checks if the iterator can be dissolved into an effective boolean value.
static Value get(int[] v, Data d, Type t, boolean c)
          Creates a node sequence with the given data reference and pre values.
static Value get(IntList v, Data d, boolean docs, boolean c)
          Creates a node sequence with the given data reference and pre values.
 DBNode itemAt(long pos)
          Gets the item at the given position in the value.
 boolean iterable()
          Returns true if the expression is iterable, i.e., if it will not contain any duplicate nodes and if all nodes will be are sorted.
 Value reverse()
          Returns a sequence in reverse order.
 boolean sameAs(Expr cmp)
          Compares the current and specified expression for equality.
 Value sub(long start, long length)
          Returns a subsequence.
 
Methods inherited from class org.basex.query.value.seq.NativeSeq
homogeneous, type, writeTo
 
Methods inherited from class org.basex.query.value.seq.Seq
get, get, hash, item, iter, plan, size, test, toJava, toString
 
Methods inherited from class org.basex.query.value.Value
accept, cache, checkUp, compile, copy, count, description, 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, isItem, isVacuous, markTailCalls, optimize, uses, visitAll
 
Methods inherited from class org.basex.data.ExprInfo
addPlan, addPlan, info, planAttr, planElem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pres

public final int[] pres
Pre values.


complete

public final boolean complete
Complete.

Method Detail

data

public Data data()
Description copied from class: Value
Returns the data reference (if) attached to this value. This method is overwritten by DBNode and DBNodeSeq.

Overrides:
data in class Value
Returns:
data reference

ebv

public Item ebv(QueryContext ctx,
                InputInfo ii)
Description copied from class: Expr
Checks if the iterator can be dissolved into an effective boolean value. If not, returns an error. If yes, returns the first value - which can be also be e.g. an integer, which is later evaluated as numeric predicate.

Overrides:
ebv in class NativeSeq
Parameters:
ctx - query context
ii - input info
Returns:
item

iterable

public boolean iterable()
Description copied from class: Expr
Returns true if the expression is iterable, i.e., if it will not contain any duplicate nodes and if all nodes will be are sorted. The return value of this method is only relevant for node sequences. It is e.g. called by AxisPath.

Overrides:
iterable in class Expr
Returns:
result of check

sameAs

public boolean sameAs(Expr cmp)
Description copied from class: Expr
Compares the current and specified expression for equality.

Overrides:
sameAs in class Expr
Parameters:
cmp - expression to be compared
Returns:
result of check

itemAt

public DBNode itemAt(long pos)
Description copied from class: Value
Gets the item at the given position in the value.

Specified by:
itemAt in class Value
Parameters:
pos - position
Returns:
item

sub

public Value sub(long start,
                 long length)
Description copied from class: Seq
Returns a subsequence.

Specified by:
sub in class Seq
Parameters:
start - first value
length - length of sequence
Returns:
resulting item or sequence

reverse

public Value reverse()
Description copied from class: Seq
Returns a sequence in reverse order.

Specified by:
reverse in class Seq
Returns:
sequence

get

public static Value get(IntList v,
                        Data d,
                        boolean docs,
                        boolean c)
Creates a node sequence with the given data reference and pre values.

Parameters:
v - pre values
d - data reference
docs - indicates if all values reference document nodes
c - indicates if values include all document nodes of a database
Returns:
resulting item or sequence

get

public static Value get(int[] v,
                        Data d,
                        Type t,
                        boolean c)
Creates a node sequence with the given data reference and pre values.

Parameters:
v - pre values
d - data reference
t - node type
c - indicates if values include all document nodes of a database
Returns:
resulting item or sequence