org.basex.query.up.primitives
Class BasicOperation

java.lang.Object
  extended by org.basex.query.up.primitives.Operation
      extended by org.basex.query.up.primitives.BasicOperation
All Implemented Interfaces:
java.lang.Comparable<BasicOperation>
Direct Known Subclasses:
DBDelete, DBDrop, DBFlush, DBNew, DBRename, DBStore, Put

public abstract class BasicOperation
extends Operation
implements java.lang.Comparable<BasicOperation>

Basic task that operates on the database but is not an update primitive. This task is carried out after all updates on the database have been made effective in the order of the BasicOperation.TYPE. Hence changes made during a snapshot will be reflected by this task.

Author:
BaseX Team 2005-12, BSD License, Lukas Kircher

Nested Class Summary
static class BasicOperation.TYPE
          Basic Operation types.
 
Field Summary
 BasicOperation.TYPE type
          Type of this operation.
 
Fields inherited from class org.basex.query.up.primitives.Operation
data, info
 
Constructor Summary
BasicOperation(BasicOperation.TYPE t, Data d, InputInfo ii)
          Constructor.
 
Method Summary
abstract  void apply()
          Applies this operation.
 int compareTo(BasicOperation o)
           
 Data getData()
          Returns the target data reference.
 InputInfo getInfo()
          Input info.
 DBNode getTargetNode()
          Returns the target node of this operation.
abstract  void merge(BasicOperation o)
          Merges this operation with the given one.
abstract  void prepare(MemData tmp)
          Prepares this operation.
 
Methods inherited from class org.basex.query.up.primitives.Operation
size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

public final BasicOperation.TYPE type
Type of this operation.

Constructor Detail

BasicOperation

public BasicOperation(BasicOperation.TYPE t,
                      Data d,
                      InputInfo ii)
Constructor.

Parameters:
t - type of this operation
d - target data reference
ii - input info
Method Detail

compareTo

public final int compareTo(BasicOperation o)
Specified by:
compareTo in interface java.lang.Comparable<BasicOperation>

getTargetNode

public DBNode getTargetNode()
Description copied from class: Operation
Returns the target node of this operation.

Specified by:
getTargetNode in class Operation
Returns:
target node

getInfo

public final InputInfo getInfo()
Description copied from class: Operation
Input info.

Specified by:
getInfo in class Operation
Returns:
input info

getData

public final Data getData()
Description copied from class: Operation
Returns the target data reference.

Specified by:
getData in class Operation
Returns:
data

merge

public abstract void merge(BasicOperation o)
                    throws QueryException
Merges this operation with the given one.

Parameters:
o - operation to merge into this one
Throws:
QueryException - exception

apply

public abstract void apply()
                    throws QueryException
Applies this operation.

Throws:
QueryException - exception

prepare

public abstract void prepare(MemData tmp)
                      throws QueryException
Prepares this operation.

Parameters:
tmp - temporary mem data
Throws:
QueryException - exception