|
||||||||
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
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 java.util.Vector<MTBGraphEdge> |
edges
Vector of included graph edges. |
protected java.util.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(java.util.Vector<MTBGraphNode<?>> nodes,
java.util.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. |
java.util.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. |
java.util.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 boolean directed
protected java.util.Vector<MTBGraphEdge> edges
protected java.util.Vector<MTBGraphNode<?>> nodes
protected int numberOfEdges
protected int numberOfNodes
Constructor Detail |
---|
public MTBGraph()
public MTBGraph(boolean directed)
public MTBGraph(java.util.Vector<MTBGraphNode<?>> nodes, java.util.Vector<MTBGraphEdge> edges, boolean directed)
nodes
- vector of MTBGraphNodesedges
- vector of MTBGraphEdgesdirected
- true if MTBGraph is directedMethod Detail |
---|
public void addEdge(MTBGraphEdge edge)
edge
- MTBGraphEdge to addpublic void addNode(MTBGraphNode<?> node)
node
- MTBGraphNode to addpublic int getEdgeNum()
public java.util.Vector<MTBGraphEdge> getEdges()
public double getGraphCost()
public int getNodeNum()
public java.util.Vector<MTBGraphNode<?>> getNodes()
public boolean isDirected()
public void print()
public void removeEdge(MTBGraphEdge edge)
public void removeNode(MTBGraphNode<?> node)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |