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>originalLinksadjacent 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 protectedConjugateLinkImpl(ConjugateLinkImpl other, boolean deepCopy)Copy constructorprotectedConjugateLinkImpl(IdGroupingToken groupId, ConjugateDirectedVertex nodeA, ConjugateDirectedVertex nodeB, Link originalLink1, Link originalLink2)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConjugateLinkImpldeepClone()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.LineStringgetGeometry()Geometry not supported on conjugate edge, collect from original underlying edge segments instead if requireddoublegetLengthKm()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).voidsetGeometry(org.locationtech.jts.geom.LineString geometry)Geometry not supported on conjugate edge, collect from original underlying edge segments instead if requiredvoidsetLengthKm(double lengthInKm)Length not supported on conjugate edge, set on original underlying edges instead if requiredConjugateLinkImplshallowClone()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:
getLengthKmin interfaceEdge- Overrides:
getLengthKmin 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:
setLengthKmin interfaceEdge- Overrides:
setLengthKmin 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:
getGeometryin interfaceEdge- Overrides:
getGeometryin 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:
setGeometryin interfaceEdge- Overrides:
setGeometryin classEdgeImpl<ConjugateDirectedVertex>- Parameters:
geometry- to use
-
shallowClone
public ConjugateLinkImpl shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClonein interfaceConjugateDirectedEdge- Specified by:
shallowClonein interfaceConjugateLink- Specified by:
shallowClonein interfaceDirectedEdge- Specified by:
shallowClonein interfaceEdge- Specified by:
shallowClonein interfaceGraphEntity- Specified by:
shallowClonein interfaceIdAble- Overrides:
shallowClonein 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:
deepClonein interfaceConjugateDirectedEdge- Specified by:
deepClonein interfaceConjugateLink- Specified by:
deepClonein interfaceDirectedEdge- Specified by:
deepClonein interfaceEdge- Specified by:
deepClonein interfaceGraphEntity- Specified by:
deepClonein interfaceIdAble- Overrides:
deepClonein 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:
getOriginalAdjacentEdgesin interfaceConjugateDirectedEdge- Returns:
- directed original adjacent edge pair
-
-