Package ons
Class Link
java.lang.Object
ons.Link
public abstract class Link
extends java.lang.Object
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Link(int id, int src, int dst, double delay, double weight)
Creates a new Fiberlink object. -
Method Summary
Modifier and Type Method Description double
getDelay()
Retrieves the propagation delay for a given Link.int
getDestination()
Retrieves the destination node for a given Link.int
getID()
Retrieves the unique identifier for a given Link.int
getSource()
Retrieves the source node for a given Link.double
getWeight()
Retrieves the weight for a given Link.void
setWeight(double weight)
abstract java.lang.String
toString()
Prints all information related to the Link object.
-
Field Details
-
Constructor Details
-
Link
public Link(int id, int src, int dst, double delay, double weight)Creates a new Fiberlink object.- Parameters:
id
- unique identifiersrc
- source nodedst
- destination nodedelay
- propagation delay (miliseconds)weight
- optional link weight
-
-
Method Details
-
getID
public int getID()Retrieves the unique identifier for a given Link.- Returns:
- the value of the Link's id attribute
-
getSource
public int getSource()Retrieves the source node for a given Link.- Returns:
- the value of the Link's src attribute
-
getDestination
public int getDestination()Retrieves the destination node for a given Link.- Returns:
- the value of the Link's dst attribute
-
getWeight
public double getWeight()Retrieves the weight for a given Link.- Returns:
- the value of the Link's weight attribute
-
setWeight
public void setWeight(double weight) -
getDelay
public double getDelay()Retrieves the propagation delay for a given Link.- Returns:
- the value of the WDMLink's delay attribute
-
toString
public abstract java.lang.String toString()Prints all information related to the Link object.- Overrides:
toString
in classjava.lang.Object
- Returns:
- string containing all the values of the link's parameters.
-