org.basex.query.up.primitives
Class Put

java.lang.Object
  extended by org.basex.query.up.primitives.Operation
      extended by org.basex.query.up.primitives.BasicOperation
          extended by org.basex.query.up.primitives.Put
All Implemented Interfaces:
java.lang.Comparable<BasicOperation>

public final class Put
extends BasicOperation

Fn:put operation primitive.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class org.basex.query.up.primitives.BasicOperation
BasicOperation.TYPE
 
Field Summary
 int nodeid
          Node id of the target node.
 
Fields inherited from class org.basex.query.up.primitives.BasicOperation
type
 
Fields inherited from class org.basex.query.up.primitives.Operation
data, info
 
Constructor Summary
Put(InputInfo i, int id, Data d, java.lang.String u)
          Constructor.
 
Method Summary
 void apply()
          Applies this operation.
 DBNode getTargetNode()
          Returns the target node of this operation.
 void merge(BasicOperation o)
          Merges this operation with the given one.
 void prepare(MemData tmp)
          Prepares this operation.
 int size()
          Returns the total number of node operations.
 java.lang.String toString()
           
 
Methods inherited from class org.basex.query.up.primitives.BasicOperation
compareTo, getData, getInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nodeid

public final int nodeid
Node id of the target node. Target nodes are identified via their ID, as structural changes (delete/insert) during the snapshot lead to PRE value shifts on disk. In addition, deleted/replaced nodes will not be serialized by fn:put as the identity of these nodes is gone - which is easier to track operating on IDs.

Constructor Detail

Put

public Put(InputInfo i,
           int id,
           Data d,
           java.lang.String u)
Constructor.

Parameters:
i - input info
id - target node id
d - target data reference
u - location path URI
Method Detail

apply

public void apply()
           throws QueryException
Description copied from class: BasicOperation
Applies this operation.

Specified by:
apply in class BasicOperation
Throws:
QueryException - exception

merge

public void merge(BasicOperation o)
           throws QueryException
Description copied from class: BasicOperation
Merges this operation with the given one.

Specified by:
merge in class BasicOperation
Parameters:
o - operation to merge into this one
Throws:
QueryException - exception

size

public int size()
Description copied from class: Operation
Returns the total number of node operations.

Specified by:
size in class Operation
Returns:
number of updates

toString

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

prepare

public void prepare(MemData tmp)
             throws QueryException
Description copied from class: BasicOperation
Prepares this operation.

Specified by:
prepare in class BasicOperation
Parameters:
tmp - temporary mem data
Throws:
QueryException - exception

getTargetNode

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

Overrides:
getTargetNode in class BasicOperation
Returns:
target node