org.basex.server
Class LocalQuery

java.lang.Object
  extended by org.basex.server.Query
      extended by org.basex.server.LocalQuery

public class LocalQuery
extends Query

This class defines all methods for iteratively evaluating queries locally. All data is interpreted by the QueryListener.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Field Summary
 
Fields inherited from class org.basex.server.Query
cache, out
 
Constructor Summary
protected LocalQuery(java.lang.String q, Context ctx, java.io.OutputStream o)
          Constructor.
 
Method Summary
 void bind(java.lang.String n, java.lang.Object v, java.lang.String t)
          Binds a value with an optional type to an external variable.
protected  void cache()
          Caches the query result.
 void close()
          Closes the query.
 void context(java.lang.Object v, java.lang.String t)
          Binds a value with an optional type to an external variable.
 java.lang.String execute()
          Returns the complete result of the query.
 java.lang.String info()
          Returns query info.
 java.lang.String options()
          Returns the serialization options.
 boolean updating()
          Returns true if the query may perform updates.
 
Methods inherited from class org.basex.server.Query
bind, cache, context, more, next, type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalQuery

protected LocalQuery(java.lang.String q,
                     Context ctx,
                     java.io.OutputStream o)
Constructor. Query output will be written to the provided output stream. All methods will return null.

Parameters:
q - query string
ctx - database context
o - output stream to write query output
Method Detail

bind

public void bind(java.lang.String n,
                 java.lang.Object v,
                 java.lang.String t)
          throws java.io.IOException
Description copied from class: Query
Binds a value with an optional type to an external variable.

Specified by:
bind in class Query
Parameters:
n - name of variable
v - value to be bound
t - data type (may be null)
Throws:
java.io.IOException - I/O exception

context

public void context(java.lang.Object v,
                    java.lang.String t)
             throws java.io.IOException
Description copied from class: Query
Binds a value with an optional type to an external variable.

Specified by:
context in class Query
Parameters:
v - value to be bound
t - data type (may be null)
Throws:
java.io.IOException - I/O exception

cache

protected void cache()
              throws java.io.IOException
Description copied from class: Query
Caches the query result.

Specified by:
cache in class Query
Throws:
java.io.IOException - I/O exception

execute

public java.lang.String execute()
                         throws java.io.IOException
Description copied from class: Query
Returns the complete result of the query.

Specified by:
execute in class Query
Returns:
item string or null.
Throws:
java.io.IOException - I/O exception

info

public java.lang.String info()
                      throws java.io.IOException
Description copied from class: Query
Returns query info.

Specified by:
info in class Query
Returns:
query info
Throws:
java.io.IOException - I/O exception

options

public java.lang.String options()
                         throws java.io.IOException
Description copied from class: Query
Returns the serialization options.

Specified by:
options in class Query
Returns:
serialization options.
Throws:
java.io.IOException - I/O exception

updating

public boolean updating()
                 throws java.io.IOException
Description copied from class: Query
Returns true if the query may perform updates.

Specified by:
updating in class Query
Returns:
updating flag
Throws:
java.io.IOException - I/O exception

close

public void close()
Description copied from class: Query
Closes the query.

Specified by:
close in class Query