Skip to content

Commit

Permalink
rename AttributedGraphEdge to AttributedEdge
Browse files Browse the repository at this point in the history
  • Loading branch information
danthe1st committed Nov 13, 2024
1 parent 5e69408 commit e2c89e5
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
* An edge in an {@link AttributedGraph attributed graph}.
* @param <N> The type of the nodes
*/
public interface AttributedGraphEdge<N extends AttributedNode> extends CommonEdge<N>, AttributeAware {
public interface AttributedEdge<N extends AttributedNode> extends CommonEdge<N>, AttributeAware {

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @param <N> The type of the nodes
* @param <E> The type of the edges
*/
public interface AttributedGraph<N extends AttributedNode, E extends AttributedGraphEdge<N>> {
public interface AttributedGraph<N extends AttributedNode, E extends AttributedEdge<N>> {
N findNodeById(String id);

Collection<E> findOutgoingEdges(N node, String edgeType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.Objects;

import io.github.danthe1st.arebac.data.commongraph.attributed.AttributeValue;
import io.github.danthe1st.arebac.data.commongraph.attributed.AttributedGraphEdge;
import io.github.danthe1st.arebac.data.commongraph.attributed.AttributedEdge;

/**
* Edge of an in-memory attributed graph.
Expand All @@ -13,7 +13,7 @@
public record InMemoryGraphEdge(
InMemoryGraphNode source, InMemoryGraphNode target,
String id, String edgeType,
Map<String, AttributeValue<?>> attributes) implements AttributedGraphEdge<InMemoryGraphNode> {
Map<String, AttributeValue<?>> attributes) implements AttributedEdge<InMemoryGraphNode> {
public InMemoryGraphEdge {
Objects.requireNonNull(source);
Objects.requireNonNull(target);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import io.github.danthe1st.arebac.data.commongraph.attributed.AttributeValue;
import io.github.danthe1st.arebac.data.commongraph.attributed.AttributeValue.StringAttribute;
import io.github.danthe1st.arebac.data.commongraph.attributed.AttributedGraph;
import io.github.danthe1st.arebac.data.commongraph.attributed.AttributedGraphEdge;
import io.github.danthe1st.arebac.data.commongraph.attributed.AttributedEdge;
import io.github.danthe1st.arebac.data.commongraph.attributed.AttributedNode;
import io.github.danthe1st.arebac.data.graph_pattern.GPEdge;
import io.github.danthe1st.arebac.data.graph_pattern.GPNode;
Expand All @@ -36,7 +36,7 @@
* @param <N> The type of nodes in the graph
* @param <E> The type of edges in the graph
*/
public final class GPEval<N extends AttributedNode, E extends AttributedGraphEdge<N>> {
public final class GPEval<N extends AttributedNode, E extends AttributedEdge<N>> {

private final AttributedGraph<N, E> graph;
private final GraphPattern pattern;
Expand All @@ -51,7 +51,7 @@ public final class GPEval<N extends AttributedNode, E extends AttributedGraphEdg

private Set<List<N>> results = new HashSet<>();

public static <N extends AttributedNode, E extends AttributedGraphEdge<N>> Set<List<N>> evaluate(AttributedGraph<N, E> graph, GraphPattern pattern) {
public static <N extends AttributedNode, E extends AttributedEdge<N>> Set<List<N>> evaluate(AttributedGraph<N, E> graph, GraphPattern pattern) {
GPEval<N, E> eval = new GPEval<>(graph, pattern);
try{
eval.init();
Expand Down Expand Up @@ -423,10 +423,10 @@ private List<N> getNeighborsSatisfyingEdgeAndAttributeRequirements(GPNode curren
if(relevantEdge.isOutgoing()){
// TODO make this more efficient by finding the exact relevant edges
graphEdges = graph.findOutgoingEdges(currentNodeInDB, relevantEdge.edgeType());
neighborFinder = AttributedGraphEdge::target;
neighborFinder = AttributedEdge::target;
}else{
graphEdges = graph.findIncomingEdges(currentNodeInDB, relevantEdge.edgeType());
neighborFinder = AttributedGraphEdge::source;
neighborFinder = AttributedEdge::source;
}
graphEdges = Objects.requireNonNullElse(graphEdges, List.of());
List<N> neighborsSatisfyingRequirements = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import java.util.Objects;

import io.github.danthe1st.arebac.data.commongraph.attributed.AttributeValue;
import io.github.danthe1st.arebac.data.commongraph.attributed.AttributedGraphEdge;
import io.github.danthe1st.arebac.data.commongraph.attributed.AttributedEdge;
import io.github.danthe1st.arebac.data.commongraph.attributed.AttributedNode;
import io.github.danthe1st.arebac.jfr.events.GetAttributeEvent;
import io.github.danthe1st.arebac.jfr.events.GetAttributeEvent.ElementType;

public class JFRRecordedGraphEdge<N extends AttributedNode, E extends AttributedGraphEdge<N>> implements AttributedGraphEdge<JFRRecordedGraphNode<N>> {
public class JFRRecordedGraphEdge<N extends AttributedNode, E extends AttributedEdge<N>> implements AttributedEdge<JFRRecordedGraphNode<N>> {

private final E edge;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

import io.github.danthe1st.arebac.data.commongraph.attributed.AttributeValue;
import io.github.danthe1st.arebac.data.commongraph.attributed.AttributedGraph;
import io.github.danthe1st.arebac.data.commongraph.attributed.AttributedGraphEdge;
import io.github.danthe1st.arebac.data.commongraph.attributed.AttributedEdge;
import io.github.danthe1st.arebac.data.commongraph.attributed.AttributedNode;
import io.github.danthe1st.arebac.jfr.events.FindEdgesEvent;
import io.github.danthe1st.arebac.jfr.events.FindEdgesEvent.Direction;
import io.github.danthe1st.arebac.jfr.events.FindNodeEvent;

public class JFRRecordedGraphWrapper<N extends AttributedNode, E extends AttributedGraphEdge<N>> implements AttributedGraph<JFRRecordedGraphNode<N>, JFRRecordedGraphEdge<N, E>> {
public class JFRRecordedGraphWrapper<N extends AttributedNode, E extends AttributedEdge<N>> implements AttributedGraph<JFRRecordedGraphNode<N>, JFRRecordedGraphEdge<N, E>> {

private final AttributedGraph<N, E> graph;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import java.util.Objects;

import io.github.danthe1st.arebac.data.commongraph.attributed.AttributeValue;
import io.github.danthe1st.arebac.data.commongraph.attributed.AttributedGraphEdge;
import io.github.danthe1st.arebac.data.commongraph.attributed.AttributedEdge;
import org.neo4j.graphdb.Relationship;

public class Neo4jEdge implements AttributedGraphEdge<Neo4jNode> {
public class Neo4jEdge implements AttributedEdge<Neo4jNode> {
private final Relationship relationship;

public Neo4jEdge(Relationship relationship) {
Expand Down

0 comments on commit e2c89e5

Please sign in to comment.