Class Graph
- java.lang.Object
-
- org.processmining.rootcauseanalysis.models.graph.Graph
-
public class Graph extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EdgeaddEdge(Edge edge)NodeaddNode(Node node)booleanancestor(Node child, Node parent)Checks whether there exists an ancestry relationship between two nodes (unidirectional).booleanequals(java.lang.Object obj)java.util.Set<Edge>getEdges()java.util.Set<Edge>getEdges(Node node)Returns all edges in this graph for which the specified node is either the source or the target node.java.util.Set<Edge>getEdges(Node node, boolean source, boolean target)Returns all edges in this graph for which the specified node is either the source of the target node, depending on the specified flags.java.util.UUIDgetId()java.lang.StringgetLabel()java.util.Set<Node>getNodes()org.eclipse.collections.impl.map.mutable.UnifiedMap<java.lang.String,java.lang.Object>getProperties()inthashCode()voidsetEdges(java.util.Set<Edge> edges)voidsetNodes(java.util.Set<Node> nodes)voidsetProperties(org.eclipse.collections.impl.map.mutable.UnifiedMap<java.lang.String,java.lang.Object> properties)
-
-
-
Method Detail
-
getId
public java.util.UUID getId()
-
getNodes
public java.util.Set<Node> getNodes()
-
setNodes
public void setNodes(java.util.Set<Node> nodes)
-
getEdges
public java.util.Set<Edge> getEdges()
-
setEdges
public void setEdges(java.util.Set<Edge> edges)
-
getProperties
public org.eclipse.collections.impl.map.mutable.UnifiedMap<java.lang.String,java.lang.Object> getProperties()
-
setProperties
public void setProperties(org.eclipse.collections.impl.map.mutable.UnifiedMap<java.lang.String,java.lang.Object> properties)
-
getLabel
public java.lang.String getLabel()
-
getEdges
public java.util.Set<Edge> getEdges(Node node, boolean source, boolean target)
Returns all edges in this graph for which the specified node is either the source of the target node, depending on the specified flags.- Parameters:
node- The node that should be part of the edge.source- When set to true, edges in which the specified node is the source node are included.target- When set to true, edges in which the specified node is the target node are included.- Returns:
- The set of requested edges in which the specified node is present.
-
getEdges
public java.util.Set<Edge> getEdges(Node node)
Returns all edges in this graph for which the specified node is either the source or the target node.- Parameters:
node- The node that should be part of the edge.- Returns:
- The set of edges in which the specified node is either the source or the target node.
-
ancestor
public boolean ancestor(Node child, Node parent)
Checks whether there exists an ancestry relationship between two nodes (unidirectional). An ancestry relations exists when there is a path in the graph from the parent node to the child node. This implementation performs a depth-first search. *- Parameters:
child- The child node.parent- The parent node.- Returns:
- Whether or not there exists an ancestry relation.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-