diff --git a/src/main/java/kieker/analysis/graph/Edge.java b/src/main/java/kieker/analysis/graph/Edge.java new file mode 100644 index 0000000000000000000000000000000000000000..bc29f7609f3a64e4b5299995c99d5f0e4cb7823f --- /dev/null +++ b/src/main/java/kieker/analysis/graph/Edge.java @@ -0,0 +1,7 @@ +package kieker.analysis.graph; + +public interface Edge extends Element { + + // public Vertex getVertex(Direction direction) throws IllegalArgumentException; + +} diff --git a/src/main/java/kieker/analysis/graph/Element.java b/src/main/java/kieker/analysis/graph/Element.java new file mode 100644 index 0000000000000000000000000000000000000000..b90e87b7f82f91459b6539468bfc301f2da70239 --- /dev/null +++ b/src/main/java/kieker/analysis/graph/Element.java @@ -0,0 +1,18 @@ +package kieker.analysis.graph; + +import java.util.Set; + +public abstract interface Element { + + public <T> T getProperty(String key); + + public Set<String> getPropertyKeys(); + + public void setProperty(String key, Object value); + + public <T> T removeProperty(String key); + + public void remove(); + + public Object getId(); +} diff --git a/src/main/java/kieker/analysis/graph/Graph.java b/src/main/java/kieker/analysis/graph/Graph.java new file mode 100644 index 0000000000000000000000000000000000000000..0719646bd63fb9480b28f5a4ebd29bc66b0447d6 --- /dev/null +++ b/src/main/java/kieker/analysis/graph/Graph.java @@ -0,0 +1,21 @@ +package kieker.analysis.graph; + +public interface Graph { + + public Vertex addVertex(Object id); + + public Vertex getVertex(Object id); + + public void removeVertex(Vertex vertex); + + public Iterable<Vertex> getVertices(); + + public Edge addEdge(Object id, Vertex outVertex, Vertex inVertex); + + public Edge getEdge(Object id); + + public void removeEdge(Edge edge); + + public Iterable<Edge> getEdges(); + +} diff --git a/src/main/java/kieker/analysis/graph/Subgraph.java b/src/main/java/kieker/analysis/graph/Subgraph.java new file mode 100644 index 0000000000000000000000000000000000000000..a3beca7c78f688fb297d34926c3ce226188accba --- /dev/null +++ b/src/main/java/kieker/analysis/graph/Subgraph.java @@ -0,0 +1,5 @@ +package kieker.analysis.graph; + +public interface Subgraph { + +} diff --git a/src/main/java/kieker/analysis/graph/Vertex.java b/src/main/java/kieker/analysis/graph/Vertex.java new file mode 100644 index 0000000000000000000000000000000000000000..2581b37b93b5353bc78e956b62969de5d983a316 --- /dev/null +++ b/src/main/java/kieker/analysis/graph/Vertex.java @@ -0,0 +1,15 @@ +package kieker.analysis.graph; + +public interface Vertex extends Element { + + public Boolean hasSubgraph(); + + public Graph getSubgraph(); + + // public Iterable<Edge> getEdges(Direction direction, String... labels); + + // public Iterable<Vertex> getVertices(Direction direction, String... labels); + + // public Edge addEdge(String label, Vertex inVertex); + +} diff --git a/src/main/java/kieker/analysis/graph/impl/EdgeImp.java b/src/main/java/kieker/analysis/graph/impl/EdgeImp.java new file mode 100644 index 0000000000000000000000000000000000000000..fcf66bd41088f66225d9f274e9ecc3e0949bceed --- /dev/null +++ b/src/main/java/kieker/analysis/graph/impl/EdgeImp.java @@ -0,0 +1,9 @@ +package kieker.analysis.graph.impl; + +import kieker.analysis.graph.Edge; + +class EdgeImp extends ElementImpl implements Edge { + + // public Vertex getVertex(Direction direction) throws IllegalArgumentException; + +} diff --git a/src/main/java/kieker/analysis/graph/impl/ElementImpl.java b/src/main/java/kieker/analysis/graph/impl/ElementImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..6a1af0ef8ed0df07f6b6af5d52481ec6f832b65a --- /dev/null +++ b/src/main/java/kieker/analysis/graph/impl/ElementImpl.java @@ -0,0 +1,45 @@ +package kieker.analysis.graph.impl; + +import java.util.Set; + +import kieker.analysis.graph.Element; + +abstract class ElementImpl implements Element { + + @Override + public <T> T getProperty(final String key) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Set<String> getPropertyKeys() { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setProperty(final String key, final Object value) { + // TODO Auto-generated method stub + + } + + @Override + public <T> T removeProperty(final String key) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void remove() { + // TODO Auto-generated method stub + + } + + @Override + public Object getId() { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/src/main/java/kieker/analysis/graph/impl/GraphImpl.java b/src/main/java/kieker/analysis/graph/impl/GraphImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..c6bc37f577956056c6a979c76b44faa1ab4dbba6 --- /dev/null +++ b/src/main/java/kieker/analysis/graph/impl/GraphImpl.java @@ -0,0 +1,66 @@ +package kieker.analysis.graph.impl; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import kieker.analysis.graph.Edge; +import kieker.analysis.graph.Graph; +import kieker.analysis.graph.Vertex; + +public class GraphImpl implements Graph { + + protected Map<String, Vertex> vertices = new HashMap<String, Vertex>(); + protected Map<String, Edge> edges = new HashMap<String, Edge>(); + + public GraphImpl() {} + + @Override + public Vertex addVertex(final Object id) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Vertex getVertex(final Object id) { + // TODO exception if not exists + String idString = id.toString(); + return this.vertices.get(idString); + } + + @Override + public Iterable<Vertex> getVertices() { + return new ArrayList<Vertex>(this.vertices.values()); + } + + @Override + public void removeVertex(final Vertex vertex) { + // TODO Auto-generated method stub + + } + + @Override + public Edge addEdge(final Object id, final Vertex outVertex, final Vertex inVertex) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Edge getEdge(final Object id) { + // TODO exception if not exists + String idString = id.toString(); + return this.edges.get(idString); + } + + @Override + public Iterable<Edge> getEdges() { + return new ArrayList<Edge>(this.edges.values()); + } + + @Override + public void removeEdge(final Edge edge) { + // TODO Auto-generated method stub + + } + +} diff --git a/src/main/java/kieker/analysis/graph/impl/VertexImpl.java b/src/main/java/kieker/analysis/graph/impl/VertexImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..44f3e069c0bc98fb20e687e205b3b074854fdf2b --- /dev/null +++ b/src/main/java/kieker/analysis/graph/impl/VertexImpl.java @@ -0,0 +1,20 @@ +package kieker.analysis.graph.impl; + +import kieker.analysis.graph.Graph; +import kieker.analysis.graph.Vertex; + +class VertexImpl extends ElementImpl implements Vertex { + + @Override + public Boolean hasSubgraph() { + // TODO Auto-generated method stub + return false; + } + + @Override + public Graph getSubgraph() { + // TODO Auto-generated method stub + return null; + } + +}