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 DirectedEdgedeepClone()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 EdgeSegmentgetEdgeSegment(boolean directionAb)Edge segment in the direction indicatedEdgeSegmentgetEdgeSegmentAb()Edge segment in the direction from A to BEdgeSegmentgetEdgeSegmentBa()Edge segment in the direction from B to Adefault Collection<? extends EdgeSegment>getEdgeSegments()collect all edge segments available on the edgeDirectedVertexgetVertexA()Vertex A of the edgeDirectedVertexgetVertexB()Vertex B of the edgedefault booleanhasEdgeSegment()Verify if any edge segment existsdefault booleanhasEdgeSegmentAb()Verify if edge segment BA existsdefault booleanhasEdgeSegmentBa()Verify if edge segment BA existsdefault EdgeSegmentregisterEdgeSegment(EdgeSegment edgeSegment, boolean directionAB)Register EdgeSegment.EdgeSegmentregisterEdgeSegment(EdgeSegment edgeSegment, boolean directionAB, boolean force)Register EdgeSegment.default EdgeSegmentremoveEdgeSegment(EdgeSegment edgeSegment)Remove given edge segment from edge.EdgeSegmentremoveEdgeSegmentAb()Remove edge segmentAb from this edge.EdgeSegmentremoveEdgeSegmentBa()Remove edge segmentAb from this edge.default voidremoveEdgeSegments()Remove edge segments from this edge.voidreplace(EdgeSegment edgeSegmentToReplace, EdgeSegment edgeSegmentToReplaceWith)replace passed in edge segment (if present) with the passed in oneDirectedEdgeshallowClone()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:
getVertexAin interfaceEdge- Returns:
- vertex A
-
getVertexB
DirectedVertex getVertexB()
Vertex B of the edge- Specified by:
getVertexBin 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:
shallowClonein interfaceEdge- Specified by:
shallowClonein interfaceGraphEntity- Specified by:
shallowClonein 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
-
-