gps.network.graph
Class Link

java.lang.Object
  extended by gps.network.graph.Link

public class Link
extends java.lang.Object

Represents a link between to nodes. Can be directed (= unidirectional) or undirected (bidirectional, standard). The link has some properties that can be read with link.getProperties().

Author:
Oliver Heckmann

Constructor Summary
Link(boolean directed, int fromNode, int toNode)
          Creates new Link, standard constructor
 
Method Summary
 int fromNode()
          gets source node
 BandwidthManager getBandwidthManager()
          gets BandwidthManager
 LinkProperties getProperties()
          gets link properties
 boolean isDirected()
          check directed information
 void reset()
          reset values
 void setBandwidth(double b)
          sets bandwidth for this link
 void setBandwidthManager(BandwidthManager bm)
          set bandwidth manager for this link
 void setDelay(double d)
          sets delay for this link
 int toNode()
          gets destination node
 java.lang.String toString()
          gets string description
 void turnaround()
          exchange source node and destination node
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Link

public Link(boolean directed,
            int fromNode,
            int toNode)
Creates new Link, standard constructor

Parameters:
directed - directed or undirected
fromNode - source node
toNode - destination node
Method Detail

reset

public void reset()
reset values


toString

public java.lang.String toString()
gets string description

Overrides:
toString in class java.lang.Object
Returns:
string description

fromNode

public int fromNode()
gets source node

Returns:
source node

toNode

public int toNode()
gets destination node

Returns:
destination node

turnaround

public void turnaround()
exchange source node and destination node


getProperties

public LinkProperties getProperties()
gets link properties

Returns:
link properties

isDirected

public boolean isDirected()
check directed information

Returns:
true if directed, otherwise false

setBandwidth

public void setBandwidth(double b)
sets bandwidth for this link

Parameters:
b - new bandwidth

setDelay

public void setDelay(double d)
sets delay for this link

Parameters:
d - new delay

setBandwidthManager

public void setBandwidthManager(BandwidthManager bm)
set bandwidth manager for this link

Parameters:
bm - new bandwidth manager

getBandwidthManager

public BandwidthManager getBandwidthManager()
gets BandwidthManager

Returns:
bandwidth manager