|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.brics.xact.analysis.flowgraph.Graph<Nodetype,Edgetype>
public class Graph<Nodetype,Edgetype>
Generic directed multigraph.
Constructor Summary | |
---|---|
Graph()
Constructs an empty graph. |
Method Summary | |
---|---|
void |
addAll(Graph<Nodetype,Edgetype> other)
Adds all nodes and edges from another graph to this one. |
void |
addEdge(Nodetype from,
Nodetype to,
Edgetype data)
Adds an edge between two nodes in the graph. |
void |
addEntry(Nodetype node)
Marks an existing node as an entry node of the graph. |
void |
addNode(Nodetype node)
Adds the given node to the graph. |
void |
clearEdges()
Removes all edges. |
boolean |
containsNode(Nodetype node)
Checks whether the graph contains the given node. |
Set<Nodetype> |
getEntries()
Returns the set of entry points in the graph. |
Set<Edge<Nodetype,Edgetype>> |
getInEdges(Nodetype node)
Returns the set of ingoing edges to the specified node. |
Set<Nodetype> |
getNodes()
Returns the set of all nodes in the graph. |
int |
getNumberOfEdges()
Returns the total number of edges. |
Set<Edge<Nodetype,Edgetype>> |
getOutEdges(Nodetype node)
Returns the set of outgoing edges from the specified node. |
void |
removeEdge(Edge<Nodetype,Edgetype> edge)
Removes an existing edge between two nodes in the graph. |
void |
removeEntry(Nodetype node)
Removes an entry node of the graph. |
void |
removeInEdges(Nodetype node)
Removes all ingoing edges from the given node. |
void |
removeNode(Nodetype node)
Removes the given node from the graph. |
void |
removeOutEdges(Nodetype node)
Removes all outgoing edges from the given node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Graph()
Method Detail |
---|
public void addAll(Graph<Nodetype,Edgetype> other)
public void addEdge(Nodetype from, Nodetype to, Edgetype data)
NoSuchElementException
- if either of the nodes does not exist in the graphpublic void addEntry(Nodetype node)
NoSuchElementException
- if the node does not existpublic void addNode(Nodetype node)
public void clearEdges()
public boolean containsNode(Nodetype node)
public Set<Nodetype> getEntries()
addEntry(Object)
and removeEntry(Object)
instead of modifying the set directly.
public Set<Edge<Nodetype,Edgetype>> getInEdges(Nodetype node)
node
- a node in the graph
public Set<Nodetype> getNodes()
public int getNumberOfEdges()
public Set<Edge<Nodetype,Edgetype>> getOutEdges(Nodetype node)
node
- a node in the graph
public void removeEdge(Edge<Nodetype,Edgetype> edge)
NoSuchElementException
- if the edge does not existpublic void removeEntry(Nodetype node)
NoSuchElementException
- if the node does not existpublic void removeInEdges(Nodetype node)
public void removeNode(Nodetype node)
NoSuchElementException
- if the node does not exist in the graphpublic void removeOutEdges(Nodetype node)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |