Package org.planit.network.virtual
Class ConnectoidEdgeImpl
- java.lang.Object
-
- org.planit.graph.EdgeImpl
-
- org.planit.graph.DirectedEdgeImpl
-
- org.planit.network.virtual.ConnectoidEdgeImpl
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<Idable>
,DirectedEdge
,Edge
,ExternalIdable
,Idable
,ConnectoidEdge
public class ConnectoidEdgeImpl extends DirectedEdgeImpl implements ConnectoidEdge
Edge implementation that represent edges that exist between centroids and connectoids (their node reference), so not physical entities but rather virtual links- Author:
- markr
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected long
connectoidEdgeId
unique internal identifier across connectoid edges-
Fields inherited from class org.planit.graph.EdgeImpl
externalId, inputProperties, lengthInKm, lineGeometry, name, xmlId
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ConnectoidEdgeImpl(ConnectoidEdgeImpl connectoidEdgeImpl)
Copy constructorprotected
ConnectoidEdgeImpl(IdGroupingToken groupId, Centroid centroidA, Node nodeB, double length)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static long
generateConnectoidEdgeId(IdGroupingToken tokenId)
Generate connectoid idlong
getConnectoidEdgeId()
Return the unique id of this connectoid edgeConnectoidSegment
registerConnectoidSegment(ConnectoidSegment connectoidSegment, boolean directionAB)
Register connectoidSegment.protected void
setConnectoidEdgeId(long connectoidEdgeId)
Set the connectoidEdgeId-
Methods inherited from class org.planit.graph.DirectedEdgeImpl
clone, getEdgeSegmentAb, getEdgeSegmentBa, registerEdgeSegment, replace, setEdgeSegmentAb, setEdgeSegmentBa
-
Methods inherited from class org.planit.graph.EdgeImpl
addInputProperty, equals, generateEdgeId, getExternalId, getGeometry, getId, getInputProperty, getLengthKm, getName, getVertexA, getVertexB, getXmlId, hasExternalId, hashCode, removeVertex, removeVertexA, removeVertexB, replace, setExternalId, setGeometry, setId, setLengthKm, setName, setVertexA, setVertexB, setXmlId, validate
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.planit.utils.graph.DirectedEdge
getEdgeSegment, getEdgeSegmentAb, getEdgeSegmentBa, hasEdgeSegmentAb, hasEdgeSegmentBa, registerEdgeSegment, replace
-
Methods inherited from interface org.planit.utils.graph.Edge
addInputProperty, clone, getGeometry, getInputProperty, getLengthKm, getName, getVertexA, getVertexB, hasGeometry, hasVertex, isGeometryInAbDirection, removeVertex, replace, setGeometry, setLengthKm, setName, transformGeometry, validate
-
Methods inherited from interface org.planit.utils.id.ExternalIdable
getExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId
-
Methods inherited from interface org.planit.utils.id.Idable
compareTo, getId, idEquals, idHashCode
-
-
-
-
Constructor Detail
-
ConnectoidEdgeImpl
protected ConnectoidEdgeImpl(IdGroupingToken groupId, Centroid centroidA, Node nodeB, double length) throws PlanItException
Constructor- Parameters:
groupId
- contiguous id generation within this group for instances of this classcentroidA
- the centroid at one end of the connectoidnodeB
- the node at the other end of the connectoidlength
- length of the current connectoid- Throws:
PlanItException
- thrown if there is an error
-
ConnectoidEdgeImpl
protected ConnectoidEdgeImpl(ConnectoidEdgeImpl connectoidEdgeImpl)
Copy constructor- Parameters:
connectoidEdgeImpl
- to copy
-
-
Method Detail
-
generateConnectoidEdgeId
protected static long generateConnectoidEdgeId(IdGroupingToken tokenId)
Generate connectoid id- Parameters:
tokenId
- contiguous id generation within this group for instances of this class- Returns:
- id of connectoid edge
-
setConnectoidEdgeId
protected void setConnectoidEdgeId(long connectoidEdgeId)
Set the connectoidEdgeId- Parameters:
connectoidEdgeId
- to set
-
registerConnectoidSegment
public ConnectoidSegment registerConnectoidSegment(ConnectoidSegment connectoidSegment, boolean directionAB) throws PlanItException
Register connectoidSegment. If there already exists a connectoidSegment for that direction it is replaced and returned- Specified by:
registerConnectoidSegment
in interfaceConnectoidEdge
- Parameters:
connectoidSegment
- connectoid segment to be registereddirectionAB
- direction of travel- Returns:
- replaced ConnectoidSegment
- Throws:
PlanItException
- thrown if there is an error
-
getConnectoidEdgeId
public long getConnectoidEdgeId()
Return the unique id of this connectoid edge- Specified by:
getConnectoidEdgeId
in interfaceConnectoidEdge
- Returns:
- id of this connectoid edge
-
-