import org.simantics.utils.datastructures.Pair;
public class UpdateList {
- private HashSet<PropertyChange> changes;
+ private List<PropertyChange> changes;
public UpdateList() {
- changes = new HashSet<>();
+ changes = new ArrayList<>();
}
public UpdateList(Collection<PropertyChange> changes) {
- this.changes = new HashSet<>(changes);
+ this.changes = new ArrayList<>(changes);
}
public UpdateList(GraphChanges graphChanges, Collection<Modification> coll) {
- this.changes = new HashSet<>();
+ this.changes = new ArrayList<>();
for (Modification p : coll) {
- changes.add(create(graphChanges, p.getLeftSub(),p.getRightSub(),new Pair<Statement, Statement>(p.getLeftStm(), p.getRightStm())));
+ addChange(create(graphChanges, p.getLeftSub(),p.getRightSub(),new Pair<Statement, Statement>(p.getLeftStm(), p.getRightStm())));
}
}
}
public void addChange(PropertyChange change) {
- changes.add(change);
+ if (!changes.contains(change))
+ changes.add(change);
}
public void removeChange(PropertyChange change) {