Class Graph<T>
- java.lang.Object
- 
- hudson.plugins.project_inheritance.util.svg.Graph<T>
 
- 
- Type Parameters:
- T- the type of values in each graph node
 
 public class Graph<T> extends Object This class implements a very simple directed graph.- Author:
- mhschroe
 
- 
- 
Constructor SummaryConstructors Constructor Description Graph()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEdges(T node, T... neighbours)Simple name-wrapper foraddNode(Object, Object...), as the code for adding a node or adding edges is identical.voidaddNode(T node, T... neighbours)protected voidaddSingleEdge(T start, T end)protected voidaddSingleNode(T node)Set<T>getEdgesFor(T node)Set<T>getLeaves(Set<T> ignored)This function returns terminal leaf nodes.Set<T>getMinimalInboundEdgeNodes(Set<T> ignored)This function returns all those nodes that have the current minimum number of inbound edges.Set<T>getMinimalOutboundEdgeNodes(Set<T> ignored)This function returns all those nodes that have the current minimum of outbound edges.Set<T>getNodes()intgetNumNodes()Graph<T>getSpanningTree()voidremoveEdge(T start, T end)voidremoveNode(T node)
 
- 
- 
- 
Method Detail- 
addSingleNodeprotected void addSingleNode(T node) 
 - 
addEdgespublic void addEdges(T node, T... neighbours) Simple name-wrapper foraddNode(Object, Object...), as the code for adding a node or adding edges is identical.- Parameters:
- node- the node
- neighbours- its children
 
 - 
removeNodepublic void removeNode(T node) 
 - 
getNumNodespublic int getNumNodes() 
 - 
getLeavespublic Set<T> getLeaves(Set<T> ignored) This function returns terminal leaf nodes. That is, it returns all those nodes that do not have any outgoing edges.- Parameters:
- ignored- a set of nodes to ignore for the purpose of identifying leaves. That means those nodes will not be returned, even if they are leaves and nodes that only have edges to them are considered leaves.
- Returns:
- a set of leaf nodes.
 
 - 
getMinimalOutboundEdgeNodespublic Set<T> getMinimalOutboundEdgeNodes(Set<T> ignored) This function returns all those nodes that have the current minimum of outbound edges.- Parameters:
- ignored- a set of nodes to ignore for the purpose of counting edges.
- Returns:
- a set of nodes with minimal number of outbound edges. Will not
 contain any node from ignored.
 
 - 
getMinimalInboundEdgeNodespublic Set<T> getMinimalInboundEdgeNodes(Set<T> ignored) This function returns all those nodes that have the current minimum number of inbound edges.- Parameters:
- ignored- a set of nodes to ignore for the purpose of counting edges.
- Returns:
- a set of nodes with minimal number of inbound edges. Will not
 contain any node from ignored.
 
 
- 
 
-