Class PhysicalNetwork.Links

    • Constructor Detail

      • Links

        public Links()
        Constructor
    • Method Detail

      • registerLink

        protected Link registerLink​(Link link)
        Add link to the internal container
        Parameters:
        link - link to be registered in this network
        Returns:
        link, in case it overrides an existing link, the removed link is returned
      • registerNewLink

        public Link registerNewLink​(Node nodeA,
                                    Node nodeB,
                                    double length,
                                    String name)
                             throws PlanItException
        Create new link to network identified via its id, injecting link length directly
        Parameters:
        nodeA - the first node in this link
        nodeB - the second node in this link
        length - the length of this link
        name - the name of the link
        Returns:
        the created link
        Throws:
        PlanItException - thrown if there is an error
      • getLink

        public Link getLink​(long id)
        Get link by id
        Parameters:
        id - the id of the link
        Returns:
        the retrieved link
      • getNumberOfLinks

        public int getNumberOfLinks()
        Get the number of links on the network
        Returns:
        the number of links in the network