Package org.goplanit.graph
Class ConjugateEdgeImpl<V extends ConjugateVertex>
- 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.ConjugateEdgeImpl<V>
-
- All Implemented Interfaces:
Serializable
,Comparable<IdAble>
,ConjugateEdge
,Edge
,GraphEntity
,ExternalIdAble
,IdAble
,ManagedId
public class ConjugateEdgeImpl<V extends ConjugateVertex> extends EdgeImpl<V> implements ConjugateEdge
ConjugateEdge class connecting two conjugate vertices. ORiginal pair of adjacent edges is also provided- Author:
- markr
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Pair<Edge,Edge>
originalEdges
adjacent original 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.ConjugateEdge
CONJUGATE_EDGE_ID_CLASS
-
Fields inherited from interface org.goplanit.utils.graph.Edge
EDGE_ID_CLASS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ConjugateEdgeImpl(ConjugateEdgeImpl<V> other, boolean deepCopy)
Copy constructorprotected
ConjugateEdgeImpl(IdGroupingToken groupId, V vertexA, V vertexB, Edge originalEdge1, Edge originalEdge2)
Constructor which injects link lengths directly
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConjugateEdgeImpl<V>
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<Edge,Edge>
getOriginalEdges()
Edges in original graph representing this conjugatevoid
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 requiredConjugateEdgeImpl<V>
shallowClone()
Create a shallow copy of this entity-
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.ConjugateEdge
getVertexA, getVertexB
-
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
-
ConjugateEdgeImpl
protected ConjugateEdgeImpl(IdGroupingToken groupId, V vertexA, V vertexB, Edge originalEdge1, Edge originalEdge2)
Constructor which injects link lengths directly- Parameters:
groupId
- , contiguous id generation within this group for instances of this classvertexA
- first vertex in the linkvertexB
- second vertex in the linkoriginalEdge1
- to useoriginalEdge2
- to use
-
ConjugateEdgeImpl
protected ConjugateEdgeImpl(ConjugateEdgeImpl<V> other, boolean deepCopy)
Copy constructor- 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 ConjugateVertex>
- 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 ConjugateVertex>
- 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 ConjugateVertex>
- 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 ConjugateVertex>
- Parameters:
geometry
- to use
-
shallowClone
public ConjugateEdgeImpl<V> shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceConjugateEdge
- Specified by:
shallowClone
in interfaceEdge
- Specified by:
shallowClone
in interfaceGraphEntity
- Specified by:
shallowClone
in interfaceIdAble
- Overrides:
shallowClone
in classEdgeImpl<V extends ConjugateVertex>
- Returns:
- shallow copy of entity
-
deepClone
public ConjugateEdgeImpl<V> 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 interfaceConjugateEdge
- Specified by:
deepClone
in interfaceEdge
- Specified by:
deepClone
in interfaceGraphEntity
- Specified by:
deepClone
in interfaceIdAble
- Overrides:
deepClone
in classEdgeImpl<V extends ConjugateVertex>
- Returns:
- deep copy of entity
-
getOriginalEdges
public Pair<Edge,Edge> getOriginalEdges()
Edges in original graph representing this conjugate- Specified by:
getOriginalEdges
in interfaceConjugateEdge
- Returns:
- edges pair
-
-