Package org.goplanit.network.virtual
Class ConnectoidEdgeImpl
- 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<DirectedVertex,EdgeSegment>
-
- org.goplanit.network.virtual.ConnectoidEdgeImpl
-
- All Implemented Interfaces:
Serializable,Comparable<IdAble>,DirectedEdge,Edge,GraphEntity,ExternalIdAble,IdAble,ManagedId,ConnectoidEdge
public class ConnectoidEdgeImpl extends DirectedEdgeImpl<DirectedVertex,EdgeSegment> implements ConnectoidEdge
Edge implementation that represent edges that exist between centroids and connectoids (their node reference), so not physical entities but rather virtual links- Author:
- markr
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected longconnectoidEdgeIdunique internal identifier across connectoid edges-
Fields inherited from class org.goplanit.graph.EdgeImpl
inputProperties, lengthInKm, lineGeometry, name
-
Fields inherited from interface org.goplanit.utils.network.virtual.ConnectoidEdge
CONNECTOID_EDGE_ID_CLASS
-
Fields inherited from interface org.goplanit.utils.graph.Edge
EDGE_ID_CLASS
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedConnectoidEdgeImpl(ConnectoidEdgeImpl other, boolean deepCopy)Copy constructorprotectedConnectoidEdgeImpl(IdGroupingToken groupId, CentroidVertex centroidA, DirectedVertex vertexB, double length)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectoidEdgeImpldeepClone()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.protected static longgenerateConnectoidEdgeId(IdGroupingToken tokenId)Generate connectoid idlonggetConnectoidEdgeId()Return the unique id of this connectoid edgebooleanpopulateGeometry(boolean overwrite)Utilising the A and B vertex construct a direct line between the two points as the geometry.protected longrecreateConnectoidEdgeId(IdGroupingToken tokenId)recreate the internal connectoid edge id and set itlongrecreateManagedIds(IdGroupingToken tokenId)Recreate internal ids: id and connectoid edge idConnectoidSegmentregisterConnectoidSegment(ConnectoidSegment connectoidSegment, boolean directionAB)Register connectoidSegment.protected voidsetConnectoidEdgeId(long connectoidEdgeId)Set the connectoidEdgeIdConnectoidEdgeImplshallowClone()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, getGeometry, getInputProperty, getLengthKm, getName, getVertexA, getVertexB, removeVertex, removeVertexA, removeVertexB, replace, setGeometry, setLengthKm, setName, setVertexA, setVertexB, validate
-
Methods inherited from class org.goplanit.graph.GraphEntityImpl
generateAndSetId, generateId, 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.network.virtual.ConnectoidEdge
getCentroidVertex, getConnectoidEdgeIdClass, getNonCentroidVertex
-
Methods inherited from interface org.goplanit.utils.graph.directed.DirectedEdge
forEachSegment, getEdgeSegment, getEdgeSegmentAb, getEdgeSegmentBa, getEdgeSegments, getVertexA, getVertexB, hasEdgeSegment, hasEdgeSegmentAb, hasEdgeSegmentBa, registerEdgeSegment, registerEdgeSegment, removeEdgeSegment, removeEdgeSegmentAb, removeEdgeSegmentBa, removeEdgeSegments, replace
-
Methods inherited from interface org.goplanit.utils.graph.Edge
addInputProperty, createEnvelope, getGeometry, getIdClass, getInputProperty, getLengthKm, getName, hasGeometry, hasName, hasVertex, hasVertexA, hasVertexB, hasVertices, isGeometryInAbDirection, isGeometryInAbDirection, isVertexA, populateBasicGeometry, removeVertex, replace, setGeometry, setLengthKm, 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
resetChildManagedIdEntities
-
-
-
-
Constructor Detail
-
ConnectoidEdgeImpl
protected ConnectoidEdgeImpl(IdGroupingToken groupId, CentroidVertex centroidA, DirectedVertex vertexB, double length)
Constructor- Parameters:
groupId- contiguous id generation within this group for instances of this classcentroidA- the centroidVertex at one end of the connectoidvertexB- the vertex at the other end of the connectoidlength- length of the current connectoid
-
ConnectoidEdgeImpl
protected ConnectoidEdgeImpl(ConnectoidEdgeImpl other, boolean deepCopy)
Copy constructor- Parameters:
other- to copydeepCopy- when true, create a deep copy, shallow copy otherwise
-
-
Method Detail
-
generateConnectoidEdgeId
protected static long generateConnectoidEdgeId(IdGroupingToken tokenId)
Generate connectoid id- Parameters:
tokenId- contiguous id generation within this group for instances of this class- Returns:
- id of connectoid edge
-
setConnectoidEdgeId
protected void setConnectoidEdgeId(long connectoidEdgeId)
Set the connectoidEdgeId- Parameters:
connectoidEdgeId- to set
-
recreateConnectoidEdgeId
protected long recreateConnectoidEdgeId(IdGroupingToken tokenId)
recreate the internal connectoid edge id and set it- Parameters:
tokenId- to use- Returns:
- updated id
-
populateGeometry
public boolean populateGeometry(boolean overwrite)
Utilising the A and B vertex construct a direct line between the two points as the geometry. In case the centroid vertex has no geometry, we try to construct the closes projected point ont the parent zone's geometry instead.- Parameters:
overwrite- when true, overwrite existing geometry, otherwise ignore- Returns:
- true when successful, false otherwise
-
recreateManagedIds
public long recreateManagedIds(IdGroupingToken tokenId)
Recreate internal ids: id and connectoid edge id- Specified by:
recreateManagedIdsin interfaceManagedId- Overrides:
recreateManagedIdsin classGraphEntityImpl- Parameters:
tokenId- to use (may be null in case managed id entity does not rely on token to recreate its managed id(s))- Returns:
- recreated id
-
registerConnectoidSegment
public ConnectoidSegment registerConnectoidSegment(ConnectoidSegment connectoidSegment, boolean directionAB)
Register connectoidSegment. If there already exists a connectoidSegment for that direction it is replaced and returned- Specified by:
registerConnectoidSegmentin interfaceConnectoidEdge- Parameters:
connectoidSegment- connectoid segment to be registereddirectionAB- direction of travel- Returns:
- replaced ConnectoidSegment
-
getConnectoidEdgeId
public long getConnectoidEdgeId()
Return the unique id of this connectoid edge- Specified by:
getConnectoidEdgeIdin interfaceConnectoidEdge- Returns:
- id of this connectoid edge
-
shallowClone
public ConnectoidEdgeImpl shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClonein interfaceConnectoidEdge- Specified by:
shallowClonein interfaceDirectedEdge- Specified by:
shallowClonein interfaceEdge- Specified by:
shallowClonein interfaceGraphEntity- Specified by:
shallowClonein interfaceIdAble- Overrides:
shallowClonein classDirectedEdgeImpl<DirectedVertex,EdgeSegment>- Returns:
- shallow copy of entity
-
deepClone
public ConnectoidEdgeImpl 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 interfaceConnectoidEdge- Specified by:
deepClonein interfaceDirectedEdge- Specified by:
deepClonein interfaceEdge- Specified by:
deepClonein interfaceGraphEntity- Specified by:
deepClonein interfaceIdAble- Overrides:
deepClonein classDirectedEdgeImpl<DirectedVertex,EdgeSegment>- Returns:
- deep copy of entity
-
-