Interface ServiceLegSegment
-
- All Superinterfaces:
Comparable<IdAble>
,EdgeSegment
,ExternalIdAble
,GraphEntity
,IdAble
,ManagedId
,Serializable
- All Known Implementing Classes:
ServiceLegSegmentImpl
public interface ServiceLegSegment extends EdgeSegment
Interface for directed ServiceLegSegment part of non-directional ServiceLeg.- Author:
- markr
-
-
Field Summary
-
Fields inherited from interface org.goplanit.utils.graph.directed.EdgeSegment
EDGE_SEGMENT_ID_CLASS, getDownstreamVertex, getUpstreamVertex
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ServiceLegSegment
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.default ServiceNode
getDownstreamServiceNode()
Get the segment's downstream vertexdefault LinkSegment
getFirstPhysicalLinkSegment()
Collect the first physical link underpinning the service leg routeorg.locationtech.jts.geom.LineString
getGeometry()
Collect the geometry of this service leg segment.default LinkSegment
getLastPhysicalLinkSegment()
Collect the last parent linkServiceLeg
getParent()
Return the parent leg of this leg segmentList<? extends LinkSegment>
getPhysicalParentSegments()
Collect the links that make up this leg ordered and in direction from A to Bdefault ServiceNode
getUpstreamServiceNode()
Get the segment's upstream service nodedefault boolean
hasGeometry()
verify if geometry is present based on parent's geometrydefault boolean
hasPhysicalParentSegments()
verify if any physical parent leg segments are registered for this service leg segmentvoid
setPhysicalParentSegments(List<? extends LinkSegment> networkLayerLinkSegments)
Set the network layer links that make up this leg irrespective wether they have been set before.ServiceLegSegment
shallowClone()
Create a shallow copy of this entity-
Methods inherited from interface org.goplanit.utils.graph.directed.EdgeSegment
getDownstreamVertex, getIdClass, getLengthKm, getOppositeDirectionSegment, getParentName, getUpstreamVertex, 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
recreateManagedIds, resetChildManagedIdEntities
-
-
-
-
Method Detail
-
getParent
ServiceLeg getParent()
Return the parent leg of this leg segment- Specified by:
getParent
in interfaceEdgeSegment
- Returns:
- leg instance which is the parent of this leg segment
-
getGeometry
org.locationtech.jts.geom.LineString getGeometry()
Collect the geometry of this service leg segment. Because service leg segments comprise one or more physical link segments, they may have unique geometry compared to their opposite direction counterpart. Therefore, they are expected to be able to provide their own unique access to their geometry rather than rely on their parent, also this may be generated on the fly rather than stored on the instance- Returns:
- lineString
-
shallowClone
ServiceLegSegment shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceEdgeSegment
- Specified by:
shallowClone
in interfaceGraphEntity
- Specified by:
shallowClone
in interfaceIdAble
- Returns:
- shallow copy of entity
-
deepClone
ServiceLegSegment 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 interfaceEdgeSegment
- Specified by:
deepClone
in interfaceGraphEntity
- Specified by:
deepClone
in interfaceIdAble
- Returns:
- deep copy of entity
-
getUpstreamServiceNode
default ServiceNode getUpstreamServiceNode()
Get the segment's upstream service node- Returns:
- upstream vertex
-
getDownstreamServiceNode
default ServiceNode getDownstreamServiceNode()
Get the segment's downstream vertex- Returns:
- downstream service node
-
hasGeometry
default boolean hasGeometry()
Description copied from interface:EdgeSegment
verify if geometry is present based on parent's geometry- Specified by:
hasGeometry
in interfaceEdgeSegment
- Returns:
- true when parent has geometry, false otherwise
-
getPhysicalParentSegments
List<? extends LinkSegment> getPhysicalParentSegments()
Collect the links that make up this leg ordered and in direction from A to B- Returns:
- parent links this leg represents
-
setPhysicalParentSegments
void setPhysicalParentSegments(List<? extends LinkSegment> networkLayerLinkSegments)
Set the network layer links that make up this leg irrespective wether they have been set before. Use with caution- Parameters:
networkLayerLinkSegments
- to use
-
hasPhysicalParentSegments
default boolean hasPhysicalParentSegments()
verify if any physical parent leg segments are registered for this service leg segment- Returns:
- true when present false otherwise
-
getFirstPhysicalLinkSegment
default LinkSegment getFirstPhysicalLinkSegment()
Collect the first physical link underpinning the service leg route- Returns:
- first parent link
-
getLastPhysicalLinkSegment
default LinkSegment getLastPhysicalLinkSegment()
Collect the last parent link- Returns:
- last parent link
-
-