Package org.goplanit.zoning
Class DirectedConnectoidImpl
- java.lang.Object
-
- org.goplanit.utils.id.IdAbleImpl
-
- org.goplanit.utils.id.ExternalIdAbleImpl
-
- org.goplanit.zoning.ConnectoidImpl
-
- org.goplanit.zoning.DirectedConnectoidImpl
-
- All Implemented Interfaces:
Comparable<IdAble>
,Iterable<Zone>
,ExternalIdAble
,IdAble
,ManagedId
,Connectoid
,DirectedConnectoid
public class DirectedConnectoidImpl extends ConnectoidImpl implements DirectedConnectoid
Undirected connectoid connecting one or more (transfer/OD) zone(s) to the physical road network, each connection will yield a connectoid edge and two connectoid segments when constructing the transport network internally based on the referenced node- Author:
- markr
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.goplanit.zoning.ConnectoidImpl
ConnectoidImpl.AccessZoneProperties
-
-
Field Summary
Fields Modifier and Type Field Description protected LinkSegment
accessEdgeSegment
the access point to an infrastructure layerprotected long
directedConnectoidId
unique id across directed connectoidsprotected boolean
nodeAccessDownstream
the node access given an access edge segment is either up or downstream-
Fields inherited from class org.goplanit.zoning.ConnectoidImpl
accessZones, name, type
-
Fields inherited from interface org.goplanit.utils.zoning.Connectoid
CONNECTOID_ID_CLASS, DEFAULT_CONNECTOID_TYPE, DEFAULT_LENGTH_KM
-
Fields inherited from interface org.goplanit.utils.zoning.DirectedConnectoid
DEFAULT_NODE_ACCESS_DOWNSTREAM, DIRECTED_CONNECTOID_ID_CLASS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DirectedConnectoidImpl(IdGroupingToken idToken, boolean downstreamAccessNode, LinkSegment accessLinkSegment)
Constructorprotected
DirectedConnectoidImpl(IdGroupingToken idToken, boolean downstreamAccessNode, LinkSegment accessLinkSegment, Zone accessZone, double length)
Constructorprotected
DirectedConnectoidImpl(DirectedConnectoidImpl other, boolean deepCopy)
Copy constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DirectedConnectoidImpl
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
generateDirectedConnectoidId(IdGroupingToken groupId)
Generate directed connectoid idLinkSegment
getAccessLinkSegment()
The edge segment that provides accessDirectedVertex
getAccessVertex()
collect the access vertex for this connectoidlong
getDirectedConnectoidId()
the directed connectoid unique idboolean
isNodeAccessDownstream()
determine if the node access is downstream or notlong
recreateManagedIds(IdGroupingToken tokenId)
recreate the internal id(s) and set them including the Idable idvoid
replaceAccessLinkSegment(LinkSegment accessEdgeSegment)
Replace the access link segment for this connectoidprotected void
setAccessLinkSegment(LinkSegment accessEdgeSegment)
Set the accessEdgeSegmentprotected void
setDirectedConnectoidId(long directedConnectoidId)
set the directed connectoid idvoid
setNodeAccessDownstream(boolean nodeAccessDownstream)
set if the node access is downstream or notDirectedConnectoidImpl
shallowClone()
Create a shallow copy of this entity-
Methods inherited from class org.goplanit.zoning.ConnectoidImpl
addAccessZone, addAllowedMode, generateId, getAccessZones, getExplicitlyAllowedModes, getFirstAccessZone, getLengthKm, getName, getNumberOfAccessZones, getType, hasAccessZone, isModeAllowed, iterator, recreateAccessZoneIdMapping, setId, setLength, setName, setType
-
Methods inherited from class org.goplanit.utils.id.ExternalIdAbleImpl
getExternalId, getXmlId, setExternalId, setXmlId
-
Methods inherited from class org.goplanit.utils.id.IdAbleImpl
equals, generateAndSetId, generateId, getId, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.zoning.Connectoid
addAccessZone, addAllAccessZones, addAllowedMode, addAllowedModes, addAllowedModes, getAccessZones, getExplicitlyAllowedModes, getFirstAccessZone, getIdClass, getLengthKm, getName, getNumberOfAccessZones, getType, hasAccessZone, hasAccessZones, hasExplicitlyAllowedModes, hasLength, hasName, isAllModesAllowed, isModeAllowed, setLength, setName, setType
-
Methods inherited from interface org.goplanit.utils.zoning.DirectedConnectoid
getAccessNode, getDirectedConnectoidIdClass, hasAccessLinkSegment
-
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 java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface org.goplanit.utils.id.ManagedId
resetChildManagedIdEntities
-
-
-
-
Field Detail
-
directedConnectoidId
protected long directedConnectoidId
unique id across directed connectoids
-
accessEdgeSegment
protected LinkSegment accessEdgeSegment
the access point to an infrastructure layer
-
nodeAccessDownstream
protected boolean nodeAccessDownstream
the node access given an access edge segment is either up or downstream
-
-
Constructor Detail
-
DirectedConnectoidImpl
protected DirectedConnectoidImpl(IdGroupingToken idToken, boolean downstreamAccessNode, LinkSegment accessLinkSegment, Zone accessZone, double length)
Constructor- Parameters:
idToken
- contiguous id generation within this group for instances of this classdownstreamAccessNode
- when true access node is chosen as the downstream node of the segment, when false, upstream node is chosenaccessLinkSegment
- the link segment in the network (layer) the connectoid connects with (possibly via its downstream node)accessZone
- for the connectoidlength
- for the connection (not of the edge segment, but to access the zone)
-
DirectedConnectoidImpl
protected DirectedConnectoidImpl(IdGroupingToken idToken, boolean downstreamAccessNode, LinkSegment accessLinkSegment)
Constructor- Parameters:
idToken
- contiguous id generation within this group for instances of this classdownstreamAccessNode
- when true access node is chosen as the downstream node of the segment, when false, upstream node is chosenaccessLinkSegment
- the link segment in the network (layer) the connectoid connects with (possibly via its downstream node)
-
DirectedConnectoidImpl
protected DirectedConnectoidImpl(DirectedConnectoidImpl other, boolean deepCopy)
Copy constructor- Parameters:
other
- to copydeepCopy
- when true, create a deep copy, shallow copy otherwise
-
-
Method Detail
-
generateDirectedConnectoidId
protected static long generateDirectedConnectoidId(IdGroupingToken groupId)
Generate directed connectoid id- Parameters:
groupId
- contiguous id generation within this group for instances of this class- Returns:
- id of directed connectoid
-
setDirectedConnectoidId
protected void setDirectedConnectoidId(long directedConnectoidId)
set the directed connectoid id- Parameters:
directedConnectoidId
- to use
-
setAccessLinkSegment
protected void setAccessLinkSegment(LinkSegment accessEdgeSegment)
Set the accessEdgeSegment- Parameters:
accessEdgeSegment
- to use
-
getDirectedConnectoidId
public long getDirectedConnectoidId()
the directed connectoid unique id- Specified by:
getDirectedConnectoidId
in interfaceDirectedConnectoid
- Returns:
- directed connectoid id
-
getAccessLinkSegment
public LinkSegment getAccessLinkSegment()
The edge segment that provides access- Specified by:
getAccessLinkSegment
in interfaceDirectedConnectoid
- Returns:
- access edge segment
-
replaceAccessLinkSegment
public void replaceAccessLinkSegment(LinkSegment accessEdgeSegment)
Replace the access link segment for this connectoid- Specified by:
replaceAccessLinkSegment
in interfaceDirectedConnectoid
- Parameters:
accessEdgeSegment
- to use
-
isNodeAccessDownstream
public boolean isNodeAccessDownstream()
determine if the node access is downstream or not- Specified by:
isNodeAccessDownstream
in interfaceDirectedConnectoid
- Returns:
- true when downstream, false otherwise, i.e., upstream
-
setNodeAccessDownstream
public void setNodeAccessDownstream(boolean nodeAccessDownstream)
set if the node access is downstream or not- Specified by:
setNodeAccessDownstream
in interfaceDirectedConnectoid
- Parameters:
nodeAccessDownstream
- true to set it downstream, false otherwise
-
getAccessVertex
public DirectedVertex getAccessVertex()
collect the access vertex for this connectoid- Specified by:
getAccessVertex
in interfaceConnectoid
- Returns:
- access vertex
-
recreateManagedIds
public long recreateManagedIds(IdGroupingToken tokenId)
recreate the internal id(s) and set them including the Idable id- Specified by:
recreateManagedIds
in interfaceManagedId
- Overrides:
recreateManagedIds
in classConnectoidImpl
- Parameters:
tokenId
- to use (may be null in case managed id entity does not rely on token to recreate its managed id(s))- Returns:
- the updated internal id
-
shallowClone
public DirectedConnectoidImpl shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceConnectoid
- Specified by:
shallowClone
in interfaceDirectedConnectoid
- Specified by:
shallowClone
in interfaceIdAble
- Specified by:
shallowClone
in classConnectoidImpl
- Returns:
- shallow copy of entity
-
deepClone
public DirectedConnectoidImpl 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 interfaceConnectoid
- Specified by:
deepClone
in interfaceDirectedConnectoid
- Specified by:
deepClone
in interfaceIdAble
- Specified by:
deepClone
in classConnectoidImpl
- Returns:
- deep copy of entity
-
-