|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.MiToBo.core.datatypes.MTBGraph
@ALDMetaInfo(export=ALLOWED) public class MTBGraph
Class implements an (un-) directed MTBGraph. With each MTBGraphNode or MTBGraphEdge specific data can be associated.
MTBGraphNode
,
MTBGraphEdge
Field Summary | |
---|---|
protected boolean |
directed
True if MTBGraph is directed. |
protected Vector<MTBGraphEdge> |
edges
Vector of included graph edges. |
protected Vector<MTBGraphNode<?>> |
nodes
Vector of included graph nodes. |
protected int |
numberOfEdges
Number of edges in the MTBGraph. |
protected int |
numberOfNodes
Number of nodes in the MTBGraph. |
Constructor Summary | |
---|---|
MTBGraph()
Standard constructor. |
|
MTBGraph(boolean directed)
Constructor to create an empty undirected or directed MTBGraph. |
|
MTBGraph(Vector<MTBGraphNode<?>> nodes,
Vector<MTBGraphEdge> edges,
boolean directed)
Constructor to create an undirected or directed MTBGraph with the given nodes and edges. |
Method Summary | |
---|---|
void |
addEdge(MTBGraphEdge edge)
Add a edge to MTBGraph. |
void |
addNode(MTBGraphNode<?> node)
Add a node to MTBGraph. |
int |
getEdgeNum()
Get number of included MTBGraphEdges. |
Vector<MTBGraphEdge> |
getEdges()
Get all edges of the MTBGraph. |
double |
getGraphCost()
Get total amount of the graph costs. |
int |
getNodeNum()
Get number of included MTBGraphNodes. |
Vector<MTBGraphNode<?>> |
getNodes()
Get all nodes of the MTBGraph. |
boolean |
isDirected()
Directed or undirected graph? |
void |
print()
Print the whole MTBGraph with all its nodes and edges. |
void |
removeEdge(MTBGraphEdge edge)
Remove the specified edge from the graph |
void |
removeNode(MTBGraphNode<?> node)
Remove the specified node from the graph as well as the edges connected to it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Vector<MTBGraphNode<?>> nodes
protected Vector<MTBGraphEdge> edges
protected boolean directed
protected int numberOfNodes
protected int numberOfEdges
Constructor Detail |
---|
public MTBGraph()
public MTBGraph(boolean directed)
public MTBGraph(Vector<MTBGraphNode<?>> nodes, Vector<MTBGraphEdge> edges, boolean directed)
nodes
- vector of MTBGraphNodesedges
- vector of MTBGraphEdgesdirected
- true if MTBGraph is directedMethod Detail |
---|
public boolean isDirected()
public Vector<MTBGraphNode<?>> getNodes()
public Vector<MTBGraphEdge> getEdges()
public int getNodeNum()
public int getEdgeNum()
public void addNode(MTBGraphNode<?> node)
node
- MTBGraphNode to addpublic void addEdge(MTBGraphEdge edge)
edge
- MTBGraphEdge to addpublic double getGraphCost()
public void removeEdge(MTBGraphEdge edge)
public void removeNode(MTBGraphNode<?> node)
public void print()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |