Package org.planit.network.virtual
Class VirtualNetwork.Connectoids
- java.lang.Object
-
- org.planit.network.virtual.VirtualNetwork.Connectoids
-
- All Implemented Interfaces:
Iterable<Connectoid>
- Enclosing class:
- VirtualNetwork
public class VirtualNetwork.Connectoids extends Object implements Iterable<Connectoid>
Internal class for all Connectoid specific code
-
-
Constructor Summary
Constructors Constructor Description Connectoids()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Connectoid
getConnectoid(long id)
Get connectoid by idint
getNumberOfConnectoids()
Return number of connectoids on the networkIterator<Connectoid>
iterator()
Collect the connectoids available through an iteratorprotected Connectoid
registerConnectoid(Connectoid connectoid)
Add connectoid to the internal container If new connectoid overrides an existing connectoid, the removed connectoid is returnedConnectoid
registerNewConnectoid(Centroid centroid, Node node, double length)
Create new connectoid to from a specified centroid to a specified nodeConnectoid
registerNewConnectoid(Centroid centroid, Node node, double length, Object externalId)
Create new connectoid to from a specified centroid to a specified node-
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
-
registerConnectoid
protected Connectoid registerConnectoid(Connectoid connectoid)
Add connectoid to the internal container If new connectoid overrides an existing connectoid, the removed connectoid is returned- Parameters:
connectoid
- the connectoid to be registered- Returns:
- connectoid added
-
registerNewConnectoid
public Connectoid registerNewConnectoid(Centroid centroid, Node node, double length, Object externalId) throws PlanItException
Create new connectoid to from a specified centroid to a specified node- Parameters:
centroid
- centroid at one end of the connectoidnode
- node at other end of the connectoidlength
- length of connectiodexternalId
- external Id of connectoid- Returns:
- Connectoid object created and registered
- Throws:
PlanItException
- thrown if there is an error
-
registerNewConnectoid
public Connectoid registerNewConnectoid(Centroid centroid, Node node, double length) throws PlanItException
Create new connectoid to from a specified centroid to a specified node- Parameters:
centroid
- centroid at one end of the connectoidnode
- node at other end of the connectoidlength
- length of connectiod- Returns:
- Connectoid object created and registered
- Throws:
PlanItException
- thrown if there is an error
-
getConnectoid
public Connectoid getConnectoid(long id)
Get connectoid by id- Parameters:
id
- the id of this connectoid- Returns:
- the retrieved connectoid
-
getNumberOfConnectoids
public int getNumberOfConnectoids()
Return number of connectoids on the network- Returns:
- the number of connectoids
-
iterator
public Iterator<Connectoid> iterator()
Collect the connectoids available through an iterator- Specified by:
iterator
in interfaceIterable<Connectoid>
-
-