org.nodal.model
Interface TxnBuilder

All Superinterfaces:
Txn
All Known Implementing Classes:
memTxn

public interface TxnBuilder
extends Txn

Interface for incrementally building Txns. Created on Sep 8, 2003

Author:
leei

Method Summary
 TxnOp addOp(Node subj, Operator op)
          Create a TxnOp and add it to the list of TxnOps in this Txn.
 boolean commit()
          Commit the currently accumulated Txn.
 boolean retractOp(TxnOp op)
          Retract a TxnOp from this Txn.
 
Methods inherited from interface org.nodal.model.Txn
attribution, committed, inverse, ops, repository, resolved, subjectList, subjects
 

Method Detail

addOp

public TxnOp addOp(Node subj,
                   Operator op)
Create a TxnOp and add it to the list of TxnOps in this Txn.

Parameters:
subj - the Node that is operated on by this TxnOp
op - the Operator that modifies/creates the subj Node
Returns:
a new TxnOp that records this Operator

retractOp

public boolean retractOp(TxnOp op)
Retract a TxnOp from this Txn. Fails if the TxnOp was not produced by and addOp on this TxnBuilder.

Parameters:
op - the TxnOp to be retracted
Returns:
true if successful

commit

public boolean commit()
Commit the currently accumulated Txn.

Returns:
true if we are successfully able to commit.