org.basex.core.cmd
Class Copy

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

public final class Copy
extends Command

Evaluates the 'copy' command and creates a copy of a database.

Author:
BaseX Team 2005-12, BSD License, Andreas Weiler

Field Summary
 
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
Copy(java.lang.String db, java.lang.String newdb)
          Default constructor.
 
Method Summary
 void databases(LockResult lr)
          Adds the names of the databases that may be touched by the process.
protected  double prog()
          Returns a progress value (0 - 1).
protected  boolean run()
          Executes the command and serializes the result (internal call).
 boolean supportsProg()
          Returns true if this command returns a progress value.
protected  java.lang.String tit()
          Returns short information on this process.
 
Methods inherited from class org.basex.core.Command
build, close, databases, error, execute, execute, getOption, getOption, info, info, newData, result, run, run, setInput, setInput, stoppable, toString, updated, updating
 
Methods inherited from class org.basex.core.Proc
abort, checkStop, det, detail, listen, proc, progress, registered, registered, startTimeout, stop, stopTimeout, title
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Copy

public Copy(java.lang.String db,
            java.lang.String newdb)
Default constructor.

Parameters:
db - db name
newdb - new db name
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

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 Proc
Parameters:
lr - Container for lock result to pass around

tit

protected java.lang.String tit()
Description copied from class: Proc
Returns short information on this process. Can be overwritten to give more detailed information.

Overrides:
tit in class Proc
Returns:
header information

supportsProg

public boolean supportsProg()
Description copied from class: Command
Returns true if this command returns a progress value. This method is required by the progress dialog in the frontend.

Overrides:
supportsProg in class Command
Returns:
result of check

prog

protected double prog()
Description copied from class: Proc
Returns a progress value (0 - 1). Can be overwritten to give more detailed information.

Overrides:
prog in class Proc
Returns:
header information