org.basex.query.xquery
Class XQResult

java.lang.Object
  extended by org.basex.query.xquery.XQResult
All Implemented Interfaces:
Result

public final class XQResult
extends java.lang.Object
implements Result

This is a container for XQuery results.

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

Field Summary
 XQContext ctx
          Query context.
 Item item
          Result sequence.
 
Constructor Summary
XQResult(XQContext c, Item s)
          Constructor.
 
Method Summary
 Nodes nodes(Data data)
          Converts nodes of a XQuery result into a BaseX nodeset.
 boolean sameAs(Result v)
          Compares values for equality.
 void serialize(PrintOutput out, boolean valid)
          Serializes the stored data to the specified output stream.
 void serialize(ResultReader rr)
          Serializes the stored data to the specified reader.
 int size()
          Number of values, stored in the result instance.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ctx

public final XQContext ctx
Query context.


item

public final Item item
Result sequence.

Constructor Detail

XQResult

public XQResult(XQContext c,
                Item s)
Constructor.

Parameters:
c - query context
s - result sequence
Method Detail

nodes

public Nodes nodes(Data data)
Converts nodes of a XQuery result into a BaseX nodeset. If that's not possible,
null
is returned. This method is only called by the GUI to allow visualization of XQuery results.

Parameters:
data - data reference
Returns:
BaseX node set

sameAs

public boolean sameAs(Result v)
Compares values for equality.

Specified by:
sameAs in interface Result
Parameters:
v - value to be compared
Returns:
true if values are equal

serialize

public void serialize(PrintOutput out,
                      boolean valid)
               throws java.io.IOException
Serializes the stored data to the specified output stream.

Specified by:
serialize in interface Result
Parameters:
out - output stream
valid - well-formed output
Throws:
java.io.IOException - in case of problems with the PrintOutput

serialize

public void serialize(ResultReader rr)
               throws org.xml.sax.SAXException
Serializes the stored data to the specified reader.

Specified by:
serialize in interface Result
Parameters:
rr - default handler
Throws:
org.xml.sax.SAXException - in case of problems with the PrintOutput

size

public int size()
Number of values, stored in the result instance.

Specified by:
size in interface Result
Returns:
number of values

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object