Interface DirectedEdge
-
- All Superinterfaces:
Comparable<IdAble>
,Edge
,ExternalIdAble
,GraphEntity
,IdAble
,ManagedId
,Serializable
- All Known Subinterfaces:
ConjugateConnectoidEdge
,ConjugateDirectedEdge
,ConjugateLink
,ConnectoidEdge
,Link
,MacroscopicLink
,ServiceLeg
- All Known Implementing Classes:
ConjugateConnectoidEdgeImpl
,ConjugateDirectedEdgeImpl
,ConjugateLinkImpl
,ConnectoidEdgeImpl
,DirectedEdgeImpl
,LinkImpl
,MacroscopicLinkImpl
,ServiceLegImpl
public interface DirectedEdge extends Edge
Directed Edge interface connecting two vertices in a directional fashion. 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
-
-
Field Summary
-
Fields inherited from interface org.goplanit.utils.graph.Edge
EDGE_ID_CLASS
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description DirectedEdge
deepClone()
Deep copy, non-owned members are reference copieddefault <T extends EdgeSegment>
voidforEachSegment(Consumer<T> edgeSegmentConsumer)
Apply consumer to each edge segment of directed egde when presentdefault EdgeSegment
getEdgeSegment(boolean directionAb)
Edge segment in the direction indicatedEdgeSegment
getEdgeSegmentAb()
Edge segment in the direction from A to BEdgeSegment
getEdgeSegmentBa()
Edge segment in the direction from B to Adefault Collection<? extends EdgeSegment>
getEdgeSegments()
collect all edge segments available on the edgeDirectedVertex
getVertexA()
Vertex A of the edgeDirectedVertex
getVertexB()
Vertex B of the edgedefault boolean
hasEdgeSegment()
Verify if any edge segment existsdefault boolean
hasEdgeSegmentAb()
Verify if edge segment BA existsdefault boolean
hasEdgeSegmentBa()
Verify if edge segment BA existsdefault EdgeSegment
registerEdgeSegment(EdgeSegment edgeSegment, boolean directionAB)
Register EdgeSegment.EdgeSegment
registerEdgeSegment(EdgeSegment edgeSegment, boolean directionAB, boolean force)
Register EdgeSegment.default EdgeSegment
removeEdgeSegment(EdgeSegment edgeSegment)
Remove given edge segment from edge.EdgeSegment
removeEdgeSegmentAb()
Remove edge segmentAb from this edge.EdgeSegment
removeEdgeSegmentBa()
Remove edge segmentAb from this edge.default void
removeEdgeSegments()
Remove edge segments from this edge.void
replace(EdgeSegment edgeSegmentToReplace, EdgeSegment edgeSegmentToReplaceWith)
replace passed in edge segment (if present) with the passed in oneDirectedEdge
shallowClone()
Shallow copy-
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
recreateManagedIds, resetChildManagedIdEntities
-
-
-
-
Method Detail
-
getVertexA
DirectedVertex getVertexA()
Vertex A of the edge- Specified by:
getVertexA
in interfaceEdge
- Returns:
- vertex A
-
getVertexB
DirectedVertex getVertexB()
Vertex B of the edge- Specified by:
getVertexB
in interfaceEdge
- Returns:
- vertex B
-
registerEdgeSegment
default EdgeSegment registerEdgeSegment(EdgeSegment edgeSegment, boolean directionAB)
Register EdgeSegment. If there already exists an edgeSegment for that direction it is replaced and returned. If the edge segment has no parent edge, this edge is set. If there is a discrepancy between the edge segment's parent edge and this edge a warning is issued and the edge segment is not registered- Parameters:
edgeSegment
- the edgeSegment to be registereddirectionAB
- direction of travel- Returns:
- replaced egeSegment (if any)
-
registerEdgeSegment
EdgeSegment registerEdgeSegment(EdgeSegment edgeSegment, boolean directionAB, boolean force)
Register EdgeSegment. If there already exists an edgeSegment for that direction it is replaced and returned. If the edge segment has no parent edge, this edge is set. If there is a discrepancy between the edge segment's parent edge and this edge a warning is issued and the edge segment is not registered- Parameters:
edgeSegment
- the edgeSegment to be registereddirectionAB
- direction of travelforce
- when true the provided edge segment is always set (even if null or inconsistent, without warning)- Returns:
- replaced egeSegment (if any)
-
removeEdgeSegments
default void removeEdgeSegments()
Remove edge segments from this edge. Be careful doing this as it because it might affect the contiguous ids if the edge segment is garbage collected
-
removeEdgeSegmentAb
EdgeSegment removeEdgeSegmentAb()
Remove edge segmentAb from this edge. Be careful doing this as it because it might affect the contiguous ids if the edge segment is garbage collected- Returns:
- removed edge segment
-
removeEdgeSegmentBa
EdgeSegment removeEdgeSegmentBa()
Remove edge segmentAb from this edge. Be careful doing this as it because it might affect the contiguous ids if the edge segment is garbage collected- Returns:
- removed edge segment
-
getEdgeSegmentAb
EdgeSegment getEdgeSegmentAb()
Edge segment in the direction from A to B- Returns:
- edge segment AB
-
getEdgeSegmentBa
EdgeSegment getEdgeSegmentBa()
Edge segment in the direction from B to A- Returns:
- edge segment BA
-
replace
void replace(EdgeSegment edgeSegmentToReplace, EdgeSegment edgeSegmentToReplaceWith)
replace passed in edge segment (if present) with the passed in one- Parameters:
edgeSegmentToReplace
- the one to replaceedgeSegmentToReplaceWith
- the one to replace it with
-
shallowClone
DirectedEdge shallowClone()
Shallow copy- Specified by:
shallowClone
in interfaceEdge
- Specified by:
shallowClone
in interfaceGraphEntity
- Specified by:
shallowClone
in interfaceIdAble
- Returns:
- copy of this edge
-
deepClone
DirectedEdge deepClone()
Deep copy, non-owned members are reference copied
-
getEdgeSegment
default EdgeSegment getEdgeSegment(boolean directionAb)
Edge segment in the direction indicated- Parameters:
directionAb
- direction of segment- Returns:
- edge segment if present
-
hasEdgeSegmentBa
default boolean hasEdgeSegmentBa()
Verify if edge segment BA exists- Returns:
- true if present, false otherwise
-
hasEdgeSegmentAb
default boolean hasEdgeSegmentAb()
Verify if edge segment BA exists- Returns:
- true if present, false otherwise
-
hasEdgeSegment
default boolean hasEdgeSegment()
Verify if any edge segment exists- Returns:
- true if present, false otherwise
-
getEdgeSegments
default Collection<? extends EdgeSegment> getEdgeSegments()
collect all edge segments available on the edge- Returns:
- available edge segments
-
forEachSegment
default <T extends EdgeSegment> void forEachSegment(Consumer<T> edgeSegmentConsumer)
Apply consumer to each edge segment of directed egde when present- Type Parameters:
T
- type of edge segment- Parameters:
edgeSegmentConsumer
- to apply
-
removeEdgeSegment
default EdgeSegment removeEdgeSegment(EdgeSegment edgeSegment)
Remove given edge segment from edge. If the edge segment is not a child nothing is removed- Parameters:
edgeSegment
- to remove- Returns:
- removed edge segment, null if none is removed
-
-