cdc.graphs.core.GraphDiff Maven / Gradle / Ivy
package cdc.graphs.core;
import java.util.ArrayList;
import java.util.List;
public class GraphDiff {
private final List addedNodes = new ArrayList<>();
private final List removedNodes = new ArrayList<>();
private final List addedEdges = new ArrayList<>();
private final List removedEdges = new ArrayList<>();
public GraphDiff() {
super();
}
public void addAddedNode(N node) {
addedNodes.add(node);
}
public void addRemovedNode(N node) {
removedNodes.add(node);
}
public void addAddedEdge(E edge) {
addedEdges.add(edge);
}
public void addRemovedEdge(E edge) {
removedEdges.add(edge);
}
public List getAddedNodes() {
return addedNodes;
}
public List getRemovedNodes() {
return removedNodes;
}
public List getAddedEdges() {
return addedEdges;
}
public List getRemovedEdges() {
return removedEdges;
}
public boolean isEmpty() {
return addedNodes.isEmpty()
&& removedNodes.isEmpty()
&& addedEdges.isEmpty()
&& removedEdges.isEmpty();
}
}