org.basex.query.up.primitives
Class InsertBefore

java.lang.Object
  extended by org.basex.query.up.primitives.UpdatePrimitive
      extended by org.basex.query.up.primitives.NodeCopy
          extended by org.basex.query.up.primitives.InsertBefore

public final class InsertBefore
extends NodeCopy

Insert before primitive.

Author:
Workgroup DBIS, University of Konstanz 2005-10, ISC License, Lukas Kircher

Field Summary
 
Fields inherited from class org.basex.query.up.primitives.NodeCopy
md
 
Fields inherited from class org.basex.query.up.primitives.UpdatePrimitive
node
 
Constructor Summary
InsertBefore(Nod n, NodIter copy)
          Constructor.
 
Method Summary
 void apply(int add)
          Applies the update operation represented by this primitive to the database.
 void merge(UpdatePrimitive p)
          Merges if possible two update primitives of the same type if they have the same target node.
 PrimitiveType type()
          Returns the type of the update primitive.
 
Methods inherited from class org.basex.query.up.primitives.NodeCopy
prepare
 
Methods inherited from class org.basex.query.up.primitives.UpdatePrimitive
buildDB, mergeTexts, update
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InsertBefore

public InsertBefore(Nod n,
                    NodIter copy)
Constructor.

Parameters:
n - target node
copy - copy of nodes to be inserted
Method Detail

apply

public void apply(int add)
Description copied from class: UpdatePrimitive
Applies the update operation represented by this primitive to the database. If an 'insert before' primitive is applied to a target node t, the pre value of t changes. Thus the number of inserted nodes is added to the pre value of t for all following update operations.

Specified by:
apply in class UpdatePrimitive
Parameters:
add - size to add

merge

public void merge(UpdatePrimitive p)
Description copied from class: UpdatePrimitive
Merges if possible two update primitives of the same type if they have the same target node.

Overrides:
merge in class UpdatePrimitive
Parameters:
p - primitive to be merged with

type

public PrimitiveType type()
Description copied from class: UpdatePrimitive
Returns the type of the update primitive.

Specified by:
type in class UpdatePrimitive
Returns:
type