Package org.goplanit.network.virtual
Class ConnectoidSegmentImpl
- java.lang.Object
-
- org.goplanit.utils.id.IdAbleImpl
-
- org.goplanit.utils.id.ExternalIdAbleImpl
-
- org.goplanit.graph.GraphEntityImpl
-
- org.goplanit.graph.directed.EdgeSegmentImpl<ConnectoidEdge>
-
- org.goplanit.network.virtual.ConnectoidSegmentImpl
-
- All Implemented Interfaces:
Serializable
,Comparable<IdAble>
,EdgeSegment
,GraphEntity
,ExternalIdAble
,IdAble
,ManagedId
,ConnectoidSegment
,PcuCapacitated
public class ConnectoidSegmentImpl extends EdgeSegmentImpl<ConnectoidEdge> implements ConnectoidSegment
The link segment that connects a zone to the physical network is not a physical link segment. However in order to be able to efficiently conduct path searches this connection needs to materialise in a similar form. to do this we construct ConnectoidLinkSegment instances which are a link segment, but do not have any physical characteristics apart from connecting a zone (via its centroid) to a physical node. these segments are NOT registered on the network because they are not part of the physical network, instead they are registered on the adopted zoning. they are however injected/connected to the connectoid reference nodes in the network as link segments to provide the above mentioned interface- Author:
- markr
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.goplanit.utils.network.virtual.ConnectoidSegment
CONNECTOID_SEGMENT_ID_CLASS
-
Fields inherited from interface org.goplanit.utils.graph.directed.EdgeSegment
EDGE_SEGMENT_ID_CLASS, getDownstreamVertex, getUpstreamVertex
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ConnectoidSegmentImpl(ConnectoidSegmentImpl other, boolean deepCopy)
Copy constructorprotected
ConnectoidSegmentImpl(IdGroupingToken groupId, ConnectoidEdge parentEdge, boolean directionAb)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectoidSegmentImpl
deepClone()
An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call.protected static long
generateConnectoidSegmentId(IdGroupingToken groupId)
generate unique connectoid segment idlong
getConnectoidSegmentId()
Collect the unqiue connectoid segment idprotected long
recreateConnectoidSegmentId(IdGroupingToken tokenId)
recreate the internal connectoid segment id and set itlong
recreateManagedIds(IdGroupingToken tokenId)
Recreate internal ids: id and connectoid segment idprotected void
setConnectoidSegmentId(long connectoidSegmentId)
Set connectoid segment idConnectoidSegmentImpl
shallowClone()
Create a shallow copy of this entity-
Methods inherited from class org.goplanit.graph.directed.EdgeSegmentImpl
getParent, isDirectionAb, removeParentEdge, setParent, validate, 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
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.network.virtual.ConnectoidSegment
getCapacityOrDefaultPcuH, getCapacityOrDefaultPcuHLane, getConnectoidSegmentIdClass
-
Methods inherited from interface org.goplanit.utils.graph.directed.EdgeSegment
getDownstreamVertex, getIdClass, getLengthKm, getOppositeDirectionSegment, getParent, getParentName, getUpstreamVertex, hasGeometry, hasParent, hasParentName, isAdjacent, isDirectionAb, isParentGeometryInSegmentDirection, removeParentEdge, setParent, validate
-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
appendExternalId, appendExternalId, getExternalId, getIdsAsString, getSplitExternalId, getSplitExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId, 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
-
ConnectoidSegmentImpl
protected ConnectoidSegmentImpl(IdGroupingToken groupId, ConnectoidEdge parentEdge, boolean directionAb)
Constructor- Parameters:
groupId
- contiguous id generation within this group for instances of this classparentEdge
- parent connectoiddirectionAb
- direction of travel
-
ConnectoidSegmentImpl
protected ConnectoidSegmentImpl(ConnectoidSegmentImpl other, boolean deepCopy)
Copy constructor- Parameters:
other
- to setdeepCopy
- when true, create a deep copy, shallow copy otherwise
-
-
Method Detail
-
generateConnectoidSegmentId
protected static long generateConnectoidSegmentId(IdGroupingToken groupId)
generate unique connectoid segment id- Parameters:
groupId
- contiguous id generation within this group for instances of this class- Returns:
- linkSegmentId
-
setConnectoidSegmentId
protected void setConnectoidSegmentId(long connectoidSegmentId)
Set connectoid segment id- Parameters:
connectoidSegmentId
- to set
-
recreateConnectoidSegmentId
protected long recreateConnectoidSegmentId(IdGroupingToken tokenId)
recreate the internal connectoid segment id and set it- Parameters:
tokenId
- to use- Returns:
- updated id
-
recreateManagedIds
public long recreateManagedIds(IdGroupingToken tokenId)
Recreate internal ids: id and connectoid segment id- Specified by:
recreateManagedIds
in interfaceManagedId
- Overrides:
recreateManagedIds
in classGraphEntityImpl
- Parameters:
tokenId
- to use (may be null in case managed id entity does not rely on token to recreate its managed id(s))- Returns:
- recreated id
-
getConnectoidSegmentId
public long getConnectoidSegmentId()
Collect the unqiue connectoid segment id- Specified by:
getConnectoidSegmentId
in interfaceConnectoidSegment
- Returns:
- connectoid segment id
-
shallowClone
public ConnectoidSegmentImpl shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceConnectoidSegment
- Specified by:
shallowClone
in interfaceEdgeSegment
- Specified by:
shallowClone
in interfaceGraphEntity
- Specified by:
shallowClone
in interfaceIdAble
- Overrides:
shallowClone
in classEdgeSegmentImpl<ConnectoidEdge>
- Returns:
- shallow copy of entity
-
deepClone
public ConnectoidSegmentImpl deepClone()
An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call. To be used with caution if not called by managed id container related code- Specified by:
deepClone
in interfaceConnectoidSegment
- Specified by:
deepClone
in interfaceEdgeSegment
- Specified by:
deepClone
in interfaceGraphEntity
- Specified by:
deepClone
in interfaceIdAble
- Overrides:
deepClone
in classEdgeSegmentImpl<ConnectoidEdge>
- Returns:
- deep copy of entity
-
-