Package org.planit.network.physical
Class PhysicalNetwork.Links
- java.lang.Object
-
- org.planit.network.physical.PhysicalNetwork.Links
-
-
Constructor Summary
Constructors Constructor Description Links()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Link
getLink(long id)
Get link by idint
getNumberOfLinks()
Get the number of links on the networkIterator<Link>
iterator()
Iterator over available linksprotected Link
registerLink(Link link)
Add link to the internal containerLink
registerNewLink(Node nodeA, Node nodeB, double length, String name)
Create new link to network identified via its id, injecting link length directly-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
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 linknodeB
- the second node in this linklength
- the length of this linkname
- 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
-
-