コード例 #1
0
 /**
  * {@inheritDoc}
  *
  * @see
  *     edu.upenn.cis.orchestra.localupdates.apply.sql.IApplierStatements#add(edu.upenn.cis.orchestra.datamodel.Update)
  */
 @Override
 public void add(Update update) throws Exception {
   if (update.isInsertion()) {
     Tuple insertedTuple = update.getNewVal();
     addInsertion(insertedTuple);
   } else if (update.isDeletion()) {
     Tuple deletedTuple = update.getOldVal();
     addDeletion(deletedTuple);
   } else {
     throw new IllegalStateException(
         "Cannot process update: "
             + update.toString()
             + ". Updates should be handled as deletion/insertion pairs.");
   }
 }
コード例 #2
0
 public boolean isApplicableFor(Update u) {
   return (oldVal.equals(u.getOldVal()));
 }