org.basex.core.cmd
Class Find

java.lang.Object
  extended by org.basex.core.Proc
      extended by org.basex.core.Command
          extended by org.basex.core.cmd.AQuery
              extended by org.basex.core.cmd.Find

public final class Find
extends AQuery

Evaluates the 'find' command and processes a simplified request as XQuery.

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

Field Summary
 
Fields inherited from class org.basex.core.cmd.AQuery
result
 
Fields inherited from class org.basex.core.Command
args, context, in, mprop, out, perf, prop
 
Fields inherited from class org.basex.core.Proc
listen, updating
 
Constructor Summary
Find(java.lang.String query)
          Default constructor.
Find(java.lang.String query, boolean rt)
          Default constructor.
 
Method Summary
 void databases(LockResult lr)
          Adds the names of the databases that may be touched by the process.
static java.lang.String find(java.lang.String query, Context ctx, boolean root)
          Creates an XQuery representation for the specified query.
static java.lang.String findTable(StringList filter, TokenList cols, BoolList elem, byte[] tag, boolean root)
          Creates an XQuery representation for the specified table query.
protected  boolean run()
          Executes the command and serializes the result (internal call).
 boolean updating(Context ctx)
          Checks if the command performs updates/write operations.
 
Methods inherited from class org.basex.core.cmd.AQuery
build, query, queryNodes, result, stoppable, updated, updating
 
Methods inherited from class org.basex.core.Command
close, databases, error, execute, execute, getOption, getOption, info, info, newData, run, run, setInput, setInput, supportsProg, toString
 
Methods inherited from class org.basex.core.Proc
abort, checkStop, det, detail, listen, proc, prog, progress, registered, registered, startTimeout, stop, stopTimeout, tit, title
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Find

public Find(java.lang.String query)
Default constructor.

Parameters:
query - simplified query

Find

public Find(java.lang.String query,
            boolean rt)
Default constructor.

Parameters:
query - simplified query
rt - start from root node
Method Detail

run

protected boolean run()
Description copied from class: Command
Executes the command and serializes the result (internal call).

Specified by:
run in class Command
Returns:
success of operation

updating

public boolean updating(Context ctx)
Description copied from class: Command
Checks if the command performs updates/write operations.

Overrides:
updating in class AQuery
Parameters:
ctx - database context
Returns:
result of check

databases

public void databases(LockResult lr)
Description copied from class: Proc
Adds the names of the databases that may be touched by the process.

Overrides:
databases in class AQuery
Parameters:
lr - Container for lock result to pass around

find

public static java.lang.String find(java.lang.String query,
                                    Context ctx,
                                    boolean root)
Creates an XQuery representation for the specified query.

Parameters:
query - query
ctx - database context
root - start from root node
Returns:
query

findTable

public static java.lang.String findTable(StringList filter,
                                         TokenList cols,
                                         BoolList elem,
                                         byte[] tag,
                                         boolean root)
Creates an XQuery representation for the specified table query.

Parameters:
filter - filter terms
cols - filter columns
elem - element flag
tag - root tag
root - root flag
Returns:
query