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 LinkSegmentaccessEdgeSegmentthe access point to an infrastructure layerprotected longdirectedConnectoidIdunique id across directed connectoidsprotected booleannodeAccessDownstreamthe 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 protectedDirectedConnectoidImpl(IdGroupingToken idToken, boolean downstreamAccessNode, LinkSegment accessLinkSegment)ConstructorprotectedDirectedConnectoidImpl(IdGroupingToken idToken, boolean downstreamAccessNode, LinkSegment accessLinkSegment, Zone accessZone, double length)ConstructorprotectedDirectedConnectoidImpl(DirectedConnectoidImpl other, boolean deepCopy)Copy constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DirectedConnectoidImpldeepClone()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 longgenerateDirectedConnectoidId(IdGroupingToken groupId)Generate directed connectoid idLinkSegmentgetAccessLinkSegment()The edge segment that provides accessDirectedVertexgetAccessVertex()collect the access vertex for this connectoidlonggetDirectedConnectoidId()the directed connectoid unique idbooleanisNodeAccessDownstream()determine if the node access is downstream or notlongrecreateManagedIds(IdGroupingToken tokenId)recreate the internal id(s) and set them including the Idable idvoidreplaceAccessLinkSegment(LinkSegment accessEdgeSegment)Replace the access link segment for this connectoidprotected voidsetAccessLinkSegment(LinkSegment accessEdgeSegment)Set the accessEdgeSegmentprotected voidsetDirectedConnectoidId(long directedConnectoidId)set the directed connectoid idvoidsetNodeAccessDownstream(boolean nodeAccessDownstream)set if the node access is downstream or notDirectedConnectoidImplshallowClone()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:
getDirectedConnectoidIdin interfaceDirectedConnectoid- Returns:
- directed connectoid id
-
getAccessLinkSegment
public LinkSegment getAccessLinkSegment()
The edge segment that provides access- Specified by:
getAccessLinkSegmentin interfaceDirectedConnectoid- Returns:
- access edge segment
-
replaceAccessLinkSegment
public void replaceAccessLinkSegment(LinkSegment accessEdgeSegment)
Replace the access link segment for this connectoid- Specified by:
replaceAccessLinkSegmentin interfaceDirectedConnectoid- Parameters:
accessEdgeSegment- to use
-
isNodeAccessDownstream
public boolean isNodeAccessDownstream()
determine if the node access is downstream or not- Specified by:
isNodeAccessDownstreamin 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:
setNodeAccessDownstreamin interfaceDirectedConnectoid- Parameters:
nodeAccessDownstream- true to set it downstream, false otherwise
-
getAccessVertex
public DirectedVertex getAccessVertex()
collect the access vertex for this connectoid- Specified by:
getAccessVertexin interfaceConnectoid- Returns:
- access vertex
-
recreateManagedIds
public long recreateManagedIds(IdGroupingToken tokenId)
recreate the internal id(s) and set them including the Idable id- Specified by:
recreateManagedIdsin interfaceManagedId- Overrides:
recreateManagedIdsin 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:
shallowClonein interfaceConnectoid- Specified by:
shallowClonein interfaceDirectedConnectoid- Specified by:
shallowClonein interfaceIdAble- Specified by:
shallowClonein 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:
deepClonein interfaceConnectoid- Specified by:
deepClonein interfaceDirectedConnectoid- Specified by:
deepClonein interfaceIdAble- Specified by:
deepClonein classConnectoidImpl- Returns:
- deep copy of entity
-
-