All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cdc.graphs.core.GraphDiff Maven / Gradle / Ivy

There is a newer version: 0.71.2
Show newest version
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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy