Package ons

Class Link

java.lang.Object
ons.Link
Direct Known Subclasses:
EONLink, WDMLink

public abstract class Link
extends java.lang.Object
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected double delay  
    protected int dst  
    protected int id  
    protected int src  
    protected double weight  
  • 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • id

      protected int id
    • src

      protected int src
    • dst

      protected int dst
    • delay

      protected double delay
    • weight

      protected double weight
  • Constructor Details

    • Link

      public Link​(int id, int src, int dst, double delay, double weight)
      Creates a new Fiberlink object.
      Parameters:
      id - unique identifier
      src - source node
      dst - destination node
      delay - 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 class java.lang.Object
      Returns:
      string containing all the values of the link's parameters.