de.unihalle.informatik.MiToBo.core.datatypes
Class MTBGraphEdge

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.core.datatypes.MTBGraphEdge

public class MTBGraphEdge
extends java.lang.Object

Class implements MTBGraphEdges for the MTBGraph. Each MTBGraphEdges has data and a source / target MTBGraphNode.

Author:
misiak

Field Summary
protected  double cost
          Cost of the MTBGraphEdge.
protected  java.util.Vector<?> edgeData
          Data of the MTBGraphEdge, included in a vector object.
protected  MTBGraphNode<?> src
          Source node of the MTBGraphEdge.
protected  MTBGraphNode<?> tgt
          Target node of the MTBGraphEdge.
 
Constructor Summary
MTBGraphEdge(MTBGraphNode<?> src, MTBGraphNode<?> tgt, java.util.Vector<?> edgeData)
          Constructor to create a new MTBGraphEdge.
MTBGraphEdge(MTBGraphNode<?> src, MTBGraphNode<?> tgt, java.util.Vector<?> edgeData, double cost)
          Constructor to create a new MTBGraphEdge.
 
Method Summary
 double getCost()
          Get edge cost as double value.
 java.util.Vector<?> getData()
          Get data for current MTBGraphEdge.
 MTBGraphNode<?> getSrcNode()
          Get source node of the MTBGraphEdge.
 MTBGraphNode<?> getTgtNode()
          Get target node of the MTBGraphEdge.
 boolean nodeIsSrc(MTBGraphNode<?> node)
           
 boolean nodeIsTgt(MTBGraphNode<?> node)
           
 void setData(java.util.Vector<?> _edgeData)
          Set data for current MTBGraphEdge.
 void setData(java.util.Vector<?> _edgeData, double _cost)
          Set data for current MTBGraphEdge with the given cost.
protected  void setSrcNode(MTBGraphNode<?> node)
          Set source node of the MTBGraphEdge.
protected  void setTgtNode(MTBGraphNode<?> node)
          Set target node of the MTBGraphEdge.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cost

protected double cost
Cost of the MTBGraphEdge.


edgeData

protected java.util.Vector<?> edgeData
Data of the MTBGraphEdge, included in a vector object.


src

protected MTBGraphNode<?> src
Source node of the MTBGraphEdge.


tgt

protected MTBGraphNode<?> tgt
Target node of the MTBGraphEdge.

Constructor Detail

MTBGraphEdge

public MTBGraphEdge(MTBGraphNode<?> src,
                    MTBGraphNode<?> tgt,
                    java.util.Vector<?> edgeData)
Constructor to create a new MTBGraphEdge. The cost of the MTBGraphEdge will be set to the size of the data vector by default.

Parameters:
src - source node
tgt - target node
edgeData - data of the MTBGraphEdge

MTBGraphEdge

public MTBGraphEdge(MTBGraphNode<?> src,
                    MTBGraphNode<?> tgt,
                    java.util.Vector<?> edgeData,
                    double cost)
Constructor to create a new MTBGraphEdge.

Parameters:
src - source node
tgt - target node
edgeData - data of the MTBGraphEdge
cost - cost of the MTBGraphEdge
Method Detail

getCost

public double getCost()
Get edge cost as double value.

Returns:
Edge cost.

getData

public java.util.Vector<?> getData()
Get data for current MTBGraphEdge.


getSrcNode

public MTBGraphNode<?> getSrcNode()
Get source node of the MTBGraphEdge.


getTgtNode

public MTBGraphNode<?> getTgtNode()
Get target node of the MTBGraphEdge.


nodeIsSrc

public boolean nodeIsSrc(MTBGraphNode<?> node)

nodeIsTgt

public boolean nodeIsTgt(MTBGraphNode<?> node)

setData

public void setData(java.util.Vector<?> _edgeData)
Set data for current MTBGraphEdge. Cost is by default set to the number of elements of the edge data vector.


setData

public void setData(java.util.Vector<?> _edgeData,
                    double _cost)
Set data for current MTBGraphEdge with the given cost.


setSrcNode

protected void setSrcNode(MTBGraphNode<?> node)
Set source node of the MTBGraphEdge.


setTgtNode

protected void setTgtNode(MTBGraphNode<?> node)
Set target node of the MTBGraphEdge.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object