Class ConjugateLinkImpl
- java.lang.Object
-
- org.goplanit.utils.id.IdAbleImpl
-
- org.goplanit.utils.id.ExternalIdAbleImpl
-
- org.goplanit.graph.GraphEntityImpl
-
- org.goplanit.graph.EdgeImpl<V>
-
- org.goplanit.graph.directed.DirectedEdgeImpl<ConjugateDirectedVertex,ConjugateLinkSegment>
-
- org.goplanit.network.layer.physical.ConjugateLinkImpl
-
- All Implemented Interfaces:
Serializable
,Comparable<IdAble>
,ConjugateDirectedEdge
,DirectedEdge
,Edge
,GraphEntity
,ExternalIdAble
,IdAble
,ManagedId
,ConjugateLink
public class ConjugateLinkImpl extends DirectedEdgeImpl<ConjugateDirectedVertex,ConjugateLinkSegment> implements ConjugateLink
Conjugate (non-directional) link class connecting two conjugate nodes.Since a conjugate link is in fact a turn it may be that the node is a connectoid edge and its conjugate is not a conjugate node but a conjugate connectoid node. Therefore we use conjugate directed vertices rather than require a conjugate node as the base class
- Author:
- markr
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Pair<Link,Link>
originalLinks
adjacent original directed edges represented by this conjugate-
Fields inherited from class org.goplanit.graph.EdgeImpl
inputProperties, lengthInKm, lineGeometry, name
-
Fields inherited from interface org.goplanit.utils.network.layer.physical.ConjugateLink
CONJUGATE_LINK_ID_CLASS
-
Fields inherited from interface org.goplanit.utils.graph.Edge
EDGE_ID_CLASS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ConjugateLinkImpl(ConjugateLinkImpl other, boolean deepCopy)
Copy constructorprotected
ConjugateLinkImpl(IdGroupingToken groupId, ConjugateDirectedVertex nodeA, ConjugateDirectedVertex nodeB, Link originalLink1, Link originalLink2)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConjugateLinkImpl
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.org.locationtech.jts.geom.LineString
getGeometry()
Geometry not supported on conjugate edge, collect from original underlying edge segments instead if requireddouble
getLengthKm()
Length not supported on conjugate edge, collect from original underlying edges instead if requiredPair<? extends Link,? extends Link>
getOriginalAdjacentEdges()
Conjugate edge represents two adjacent edges in original form (potential turn movement).void
setGeometry(org.locationtech.jts.geom.LineString geometry)
Geometry not supported on conjugate edge, collect from original underlying edge segments instead if requiredvoid
setLengthKm(double lengthInKm)
Length not supported on conjugate edge, set on original underlying edges instead if requiredConjugateLinkImpl
shallowClone()
Create a shallow copy of this entity-
Methods inherited from class org.goplanit.graph.directed.DirectedEdgeImpl
getEdgeSegmentAb, getEdgeSegmentBa, registerEdgeSegment, removeEdgeSegmentAb, removeEdgeSegmentBa, replace, setEdgeSegmentAb, setEdgeSegmentBa
-
Methods inherited from class org.goplanit.graph.EdgeImpl
addInputProperty, getInputProperty, getName, getVertexA, getVertexB, removeVertex, removeVertexA, removeVertexB, replace, setName, setVertexA, setVertexB, validate
-
Methods inherited from class org.goplanit.graph.GraphEntityImpl
generateAndSetId, generateId, recreateManagedIds, 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.graph.directed.ConjugateDirectedEdge
getEdgeSegment, getEdgeSegmentAb, getEdgeSegmentBa, getEdgeSegments, getOriginalAdjacentEdgeSegments, getVertexA, getVertexB, registerEdgeSegment, removeEdgeSegmentAb, removeEdgeSegmentBa
-
Methods inherited from interface org.goplanit.utils.network.layer.physical.ConjugateLink
getConjugateLinkIdClass, getConjugateLinkSegment, getConjugateLinkSegmentAb, getConjugateLinkSegments, getConjugateNodeA, getConjugateNodeB, getLinkSegmentBa, hasConjugateLinkSegmentAb, hasConjugateLinkSegmentBa
-
Methods inherited from interface org.goplanit.utils.graph.directed.DirectedEdge
forEachSegment, hasEdgeSegment, hasEdgeSegmentAb, hasEdgeSegmentBa, registerEdgeSegment, removeEdgeSegment, removeEdgeSegments, replace
-
Methods inherited from interface org.goplanit.utils.graph.Edge
addInputProperty, createEnvelope, getIdClass, getInputProperty, getName, hasGeometry, hasName, hasVertex, hasVertexA, hasVertexB, hasVertices, isGeometryInAbDirection, isGeometryInAbDirection, isVertexA, populateBasicGeometry, removeVertex, replace, setName, transformGeometry, updateGeometryInjectCoordinateAtProjectedLocation, 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
-
-
-
-
Constructor Detail
-
ConjugateLinkImpl
protected ConjugateLinkImpl(ConjugateLinkImpl other, boolean deepCopy)
Copy constructor- Parameters:
other
- to copydeepCopy
- when true, create a deep copy, shallow copy otherwise
-
ConjugateLinkImpl
protected ConjugateLinkImpl(IdGroupingToken groupId, ConjugateDirectedVertex nodeA, ConjugateDirectedVertex nodeB, Link originalLink1, Link originalLink2)
Constructor- Parameters:
groupId
- , contiguous id generation within this group for instances of this classnodeA
- the first node in the linknodeB
- the second node in the linkoriginalLink1
- to useoriginalLink2
- to use
-
-
Method Detail
-
getLengthKm
public double getLengthKm()
Length not supported on conjugate edge, collect from original underlying edges instead if required- Specified by:
getLengthKm
in interfaceEdge
- Overrides:
getLengthKm
in classEdgeImpl<ConjugateDirectedVertex>
- Returns:
- negative infinity
-
setLengthKm
public void setLengthKm(double lengthInKm)
Length not supported on conjugate edge, set on original underlying edges instead if required- Specified by:
setLengthKm
in interfaceEdge
- Overrides:
setLengthKm
in classEdgeImpl<ConjugateDirectedVertex>
- Parameters:
lengthInKm
- to use
-
getGeometry
public org.locationtech.jts.geom.LineString getGeometry()
Geometry not supported on conjugate edge, collect from original underlying edge segments instead if required- Specified by:
getGeometry
in interfaceEdge
- Overrides:
getGeometry
in classEdgeImpl<ConjugateDirectedVertex>
- Returns:
- null
-
setGeometry
public void setGeometry(org.locationtech.jts.geom.LineString geometry)
Geometry not supported on conjugate edge, collect from original underlying edge segments instead if required- Specified by:
setGeometry
in interfaceEdge
- Overrides:
setGeometry
in classEdgeImpl<ConjugateDirectedVertex>
- Parameters:
geometry
- to use
-
shallowClone
public ConjugateLinkImpl shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceConjugateDirectedEdge
- Specified by:
shallowClone
in interfaceConjugateLink
- Specified by:
shallowClone
in interfaceDirectedEdge
- Specified by:
shallowClone
in interfaceEdge
- Specified by:
shallowClone
in interfaceGraphEntity
- Specified by:
shallowClone
in interfaceIdAble
- Overrides:
shallowClone
in classDirectedEdgeImpl<ConjugateDirectedVertex,ConjugateLinkSegment>
- Returns:
- shallow copy of entity
-
deepClone
public ConjugateLinkImpl 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 interfaceConjugateDirectedEdge
- Specified by:
deepClone
in interfaceConjugateLink
- Specified by:
deepClone
in interfaceDirectedEdge
- Specified by:
deepClone
in interfaceEdge
- Specified by:
deepClone
in interfaceGraphEntity
- Specified by:
deepClone
in interfaceIdAble
- Overrides:
deepClone
in classDirectedEdgeImpl<ConjugateDirectedVertex,ConjugateLinkSegment>
- Returns:
- deep copy of entity
-
getOriginalAdjacentEdges
public Pair<? extends Link,? extends Link> getOriginalAdjacentEdges()
Conjugate edge represents two adjacent edges in original form (potential turn movement).- Specified by:
getOriginalAdjacentEdges
in interfaceConjugateDirectedEdge
- Returns:
- directed original adjacent edge pair
-
-