public abstract class AddDeleteUpdateOp extends UpdateOp {
-<<<<<<< HEAD
protected boolean add;
-=======
- boolean add;
->>>>>>> branch 'master' of ssh://luukkainen@www.simantics.org:29418/simantics/interop
+
public AddDeleteUpdateOp(GraphChanges changes) {
super(changes);
}
@Override
- public boolean requiresParentOps() {
- return add;
+ public boolean requiresOp(UpdateOp op) {
+ if (add) {
+ if (getParentOps().contains(op))
+ return true;
+ } else {
+ if (getSubOps().contains(op))
+ return true;
+ }
+ return false;
}
-
+
@Override
- public boolean requiresSubOps() {
- return !add;
+ public boolean selectOp(UpdateOp op, boolean select) {
+ if (select) {
+ return requiresOp(op);
+ } else {
+ return op.requiresOp(this);
+ }
}
protected static void copyProperties(WriteGraph g, Resource source, Resource destination) throws DatabaseException {