Package org.goplanit.graph.directed
Class ConjugateDirectedEdgeImpl<V extends ConjugateDirectedVertex,ES extends ConjugateEdgeSegment>
- 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<V,ES>
-
- org.goplanit.graph.directed.ConjugateDirectedEdgeImpl<V,ES>
-
- All Implemented Interfaces:
Serializable
,Comparable<IdAble>
,ConjugateDirectedEdge
,DirectedEdge
,Edge
,GraphEntity
,ExternalIdAble
,IdAble
,ManagedId
- Direct Known Subclasses:
ConjugateConnectoidEdgeImpl
public class ConjugateDirectedEdgeImpl<V extends ConjugateDirectedVertex,ES extends ConjugateEdgeSegment> extends DirectedEdgeImpl<V,ES> implements ConjugateDirectedEdge
Conjugate Edge implementation class connecting two vertices via some geometry. Each edge has one or two underlying edge segments in a particular direction which may carry additional information for each particular direction of the edge.- Author:
- markr
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Pair<DirectedEdge,DirectedEdge>
originalEdges
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.graph.Edge
EDGE_ID_CLASS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ConjugateDirectedEdgeImpl(ConjugateDirectedEdgeImpl<V,ES> other, boolean deepCopy)
Copy Constructor.protected
ConjugateDirectedEdgeImpl(IdGroupingToken groupId, V vertexA, V vertexB, DirectedEdge originalEdge1, DirectedEdge originalEdge2)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConjugateDirectedEdgeImpl<V,ES>
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<DirectedEdge,DirectedEdge>
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 requiredConjugateDirectedEdgeImpl<V,ES>
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.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
-
-
-
-
Field Detail
-
originalEdges
protected final Pair<DirectedEdge,DirectedEdge> originalEdges
adjacent original directed edges represented by this conjugate
-
-
Constructor Detail
-
ConjugateDirectedEdgeImpl
protected ConjugateDirectedEdgeImpl(IdGroupingToken groupId, V vertexA, V vertexB, DirectedEdge originalEdge1, DirectedEdge originalEdge2)
Constructor- Parameters:
groupId
- , contiguous id generation within this group for instances of this classvertexA
- first conjugate vertex in the linkvertexB
- second conjugate vertex in the linkoriginalEdge1
- to useoriginalEdge2
- to use
-
ConjugateDirectedEdgeImpl
protected ConjugateDirectedEdgeImpl(ConjugateDirectedEdgeImpl<V,ES> other, boolean deepCopy)
Copy Constructor. Edge segments are shallow copied and point to the passed in edge as their parent So additional effort is needed to make the new edge usable- Parameters:
other
- to copydeepCopy
- when true, create a deep copy, shallow copy otherwise
-
-
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<V extends 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<V extends 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<V extends 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<V extends ConjugateDirectedVertex>
- Parameters:
geometry
- to use
-
getOriginalAdjacentEdges
public Pair<DirectedEdge,DirectedEdge> getOriginalAdjacentEdges()
Conjugate edge represents two adjacent edges in original form (potential turn movement).- Specified by:
getOriginalAdjacentEdges
in interfaceConjugateDirectedEdge
- Returns:
- directed original adjacent edge pair
-
shallowClone
public ConjugateDirectedEdgeImpl<V,ES> shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceConjugateDirectedEdge
- Specified by:
shallowClone
in interfaceDirectedEdge
- Specified by:
shallowClone
in interfaceEdge
- Specified by:
shallowClone
in interfaceGraphEntity
- Specified by:
shallowClone
in interfaceIdAble
- Overrides:
shallowClone
in classDirectedEdgeImpl<V extends ConjugateDirectedVertex,ES extends ConjugateEdgeSegment>
- Returns:
- shallow copy of entity
-
deepClone
public ConjugateDirectedEdgeImpl<V,ES> 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 interfaceDirectedEdge
- Specified by:
deepClone
in interfaceEdge
- Specified by:
deepClone
in interfaceGraphEntity
- Specified by:
deepClone
in interfaceIdAble
- Overrides:
deepClone
in classDirectedEdgeImpl<V extends ConjugateDirectedVertex,ES extends ConjugateEdgeSegment>
- Returns:
- deep copy of entity
-
-