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>originalEdgesadjacent 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 protectedConjugateEdgeImpl(ConjugateEdgeImpl<V> other, boolean deepCopy)Copy constructorprotectedConjugateEdgeImpl(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.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<Edge,Edge>getOriginalEdges()Edges in original graph representing this conjugatevoidsetGeometry(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 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:
getLengthKmin interfaceEdge- Overrides:
getLengthKmin 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:
setLengthKmin interfaceEdge- Overrides:
setLengthKmin 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:
getGeometryin interfaceEdge- Overrides:
getGeometryin 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:
setGeometryin interfaceEdge- Overrides:
setGeometryin classEdgeImpl<V extends ConjugateVertex>- Parameters:
geometry- to use
-
shallowClone
public ConjugateEdgeImpl<V> shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClonein interfaceConjugateEdge- Specified by:
shallowClonein interfaceEdge- Specified by:
shallowClonein interfaceGraphEntity- Specified by:
shallowClonein interfaceIdAble- Overrides:
shallowClonein 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:
deepClonein interfaceConjugateEdge- Specified by:
deepClonein interfaceEdge- Specified by:
deepClonein interfaceGraphEntity- Specified by:
deepClonein interfaceIdAble- Overrides:
deepClonein classEdgeImpl<V extends ConjugateVertex>- Returns:
- deep copy of entity
-
getOriginalEdges
public Pair<Edge,Edge> getOriginalEdges()
Edges in original graph representing this conjugate- Specified by:
getOriginalEdgesin interfaceConjugateEdge- Returns:
- edges pair
-
-