Package org.goplanit.network.virtual
Class ConnectoidEdgeImpl
- java.lang.Object
-
- org.goplanit.utils.id.IdAbleImpl
-
- org.goplanit.utils.id.ExternalIdAbleImpl
-
- org.goplanit.graph.GraphEntityImpl
-
- org.goplanit.graph.EdgeImpl
-
- org.goplanit.graph.directed.DirectedEdgeImpl
-
- org.goplanit.network.virtual.ConnectoidEdgeImpl
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<IdAble>
,DirectedEdge
,Edge
,GraphEntity
,ExternalIdAble
,IdAble
,ManagedId
,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.goplanit.graph.EdgeImpl
inputProperties, lengthInKm, lineGeometry, name
-
Fields inherited from interface org.goplanit.utils.network.virtual.ConnectoidEdge
CONNECTOID_EDGE_ID_CLASS
-
Fields inherited from interface org.goplanit.utils.graph.Edge
EDGE_ID_CLASS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ConnectoidEdgeImpl(ConnectoidEdgeImpl connectoidEdgeImpl)
Copy constructorprotected
ConnectoidEdgeImpl(IdGroupingToken groupId, Centroid centroidA, DirectedVertex vertexB, 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 edgeprotected long
recreateConnectoidEdgeId(IdGroupingToken tokenId)
recreate the internal connectoid edge id and set itlong
recreateManagedIds(IdGroupingToken tokenId)
Recreate internal ids: id and connectoid edge idConnectoidSegment
registerConnectoidSegment(ConnectoidSegment connectoidSegment, boolean directionAB)
Register connectoidSegment.protected void
setConnectoidEdgeId(long connectoidEdgeId)
Set the connectoidEdgeId-
Methods inherited from class org.goplanit.graph.directed.DirectedEdgeImpl
clone, getEdgeSegmentAb, getEdgeSegmentBa, getVertexA, getVertexB, registerEdgeSegment, replace, setEdgeSegmentAb, setEdgeSegmentBa
-
Methods inherited from class org.goplanit.graph.EdgeImpl
addInputProperty, getGeometry, getInputProperty, getLengthKm, getName, removeVertex, removeVertexA, removeVertexB, replace, setGeometry, setLengthKm, setName, setVertexA, setVertexB, validate
-
Methods inherited from class org.goplanit.graph.GraphEntityImpl
generateAndSetId, generateId, toString
-
Methods inherited from class org.goplanit.utils.id.ExternalIdAbleImpl
getExternalId, getXmlId, setExternalId, setXmlId
-
Methods inherited from class org.goplanit.utils.id.IdAbleImpl
equals, generateAndSetId, getId, hashCode, setId
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.network.virtual.ConnectoidEdge
getConnectoidSegmentIdClass
-
Methods inherited from interface org.goplanit.utils.graph.directed.DirectedEdge
getEdgeSegment, getEdgeSegmentAb, getEdgeSegmentBa, getEdgeSegments, getVertexA, getVertexB, hasEdgeSegmentAb, hasEdgeSegmentBa, registerEdgeSegment, replace
-
Methods inherited from interface org.goplanit.utils.graph.Edge
addInputProperty, clone, createEnvelope, getGeometry, getIdClass, getInputProperty, getLengthKm, getName, hasGeometry, hasName, hasVertex, isGeometryInAbDirection, removeVertex, replace, setGeometry, setLengthKm, setName, transformGeometry, validate
-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
getExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, getId, idEquals, idHashCode
-
Methods inherited from interface org.goplanit.utils.id.ManagedId
resetChildManagedIdEntities
-
-
-
-
Constructor Detail
-
ConnectoidEdgeImpl
protected ConnectoidEdgeImpl(IdGroupingToken groupId, Centroid centroidA, DirectedVertex vertexB, 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 connectoidvertexB
- the vertex 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
-
recreateConnectoidEdgeId
protected long recreateConnectoidEdgeId(IdGroupingToken tokenId)
recreate the internal connectoid edge id and set it- Parameters:
tokenId
- to use- Returns:
- updated id
-
recreateManagedIds
public long recreateManagedIds(IdGroupingToken tokenId)
Recreate internal ids: id and connectoid edge id- Specified by:
recreateManagedIds
in interfaceManagedId
- Overrides:
recreateManagedIds
in classGraphEntityImpl
- Parameters:
tokenId
- to use- Returns:
- recreated id
-
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
-
-