Package org.eclipse.jetty.deploy.graph
Class Graph
java.lang.Object
org.eclipse.jetty.deploy.graph.Graph
- Direct Known Subclasses:
AppLifeCycle
Basic directed graph implementation
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
Find 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.void
insertNode
(Edge edge, String nodeName) Convenience method forinsertNode(Edge, Node)
void
insertNode
(Edge edge, Node node) Insert an arbitrary node on an existing edge.void
removeEdge
(String fromNodeName, String toNodeName) void
removeEdge
(Edge edge) void
removeNode
(Node node) void
void
-
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
Insert an arbitrary node on an existing edge.- Parameters:
edge
- the edge to split and insert a node intonode
- the node to insert along the edge
-
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
Using BFS (Breadth First Search) return the path from a any arbitrary node to any other.- Parameters:
from
- the node fromto
- the node to- Returns:
- the path to take or null if there is no path.
-
getEdges
-
getNodeByName
Get the Node by Name.- Parameters:
name
- the name to lookup- Returns:
- the node if found or null if not found.
-
getNodes
-
removeEdge
-
removeEdge
-
removeNode
-
setEdges
-
setNodes
-