import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
import org.simantics.db.Resource;
import org.simantics.db.Statement;
return parentOps;
}
+ public <T extends UpdateOp> Collection<T> getParentOpsWithClass(Class<T> cls) {
+ List<T> ops = new ArrayList<T>(parentOps.size());
+ for (UpdateOp op : parentOps)
+ if (cls.isAssignableFrom(op.getClass()))
+ ops.add((T)op);
+ return ops;
+ }
+
public Collection<UpdateOp> getSubOps() {
return subOps;
}
+ public <T extends UpdateOp> Collection<T> getSubOpsWithClass(Class<T> cls) {
+ List<T> ops = new ArrayList<T>(subOps.size());
+ for (UpdateOp op : subOps)
+ if (cls.isAssignableFrom(op.getClass()))
+ ops.add((T)op);
+ return ops;
+ }
+
public void addParentOp(UpdateOp op) {
assert (!op.equals(this));
parentOps.add(op);