Class Graph
java.lang.Object
org.eclipse.jetty.deploy.graph.Graph
- Direct Known Subclasses:
AppLifeCycle
Basic directed graph implementation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidFind all edges that are connected to the specific node, both as an outgoingEdge.getFrom()or incomingEdge.getTo()end point.findEdgesFrom(Node from) Find all edges that are connectedEdge.getFrom()the specific node.getEdges()getNodeByName(String name) Get the Node by Name.getNodes()Convenience method forgetPath(Node, Node)Using BFS (Breadth First Search) return the path from a any arbitrary node to any other.voidinsertNode(Edge edge, String nodeName) Convenience method forinsertNode(Edge, Node)voidinsertNode(Edge edge, Node node) Insert an arbitrary node on an existing edge.voidremoveEdge(String fromNodeName, String toNodeName) voidremoveEdge(Edge edge) voidremoveNode(Node node) voidvoid
-
Constructor Details
-
Graph
public Graph()
-
-
Method Details
-
addEdge
-
addEdge
-
addNode
-
insertNode
Convenience method forinsertNode(Edge, Node)- Parameters:
edge- the edge to split and insert a node intonodeName- the name of the node to insert along the edge
-
insertNode
-
findEdges
Find all edges that are connected to the specific node, both as an outgoingEdge.getFrom()or incomingEdge.getTo()end point.- Parameters:
node- the node with potential end points- Returns:
- the set of edges connected to the node
-
findEdgesFrom
Find all edges that are connectedEdge.getFrom()the specific node.- Parameters:
from- the node with potential edges from it- Returns:
- the set of edges from the node
-
getPath
Convenience method forgetPath(Node, Node)- Parameters:
nodeNameOrigin- the name of the node to the path origin.nodeNameDest- the name of the node to the path destination.- Returns:
- the path to take
-
getPath
-
getEdges
-
getNodeByName
-
getNodes
-
removeEdge
-
removeEdge
-
removeNode
-
setEdges
-
setNodes
-