| 1 21 package com.db4o.inside.btree; 22 23 import com.db4o.Transaction; 24 25 26 public abstract class BTreePatch { 27 28 protected final Transaction _transaction; 29 30 protected Object _object; 31 32 public BTreePatch(Transaction transaction, Object obj) { 33 _transaction = transaction; 34 _object = obj; 35 } 36 37 public abstract Object commit(Transaction trans, BTree btree); 38 39 public boolean isRemove() { 40 return false; 41 } 42 43 public abstract BTreePatch forTransaction(Transaction trans); 44 45 public Object getObject() { 46 return _object; 47 } 48 49 public abstract Object rollback(Transaction trans, BTree btree); 50 51 public String toString(){ 52 if(_object == null){ 53 return "[NULL]"; 54 } 55 return _object.toString(); 56 } 57 58 public boolean isAdd() { 59 return false; 60 } 61 62 public abstract Object key(Transaction trans); 63 } 64 | Popular Tags |