Interface DirectedEdge
-
- All Superinterfaces:
Cloneable
,Comparable<IdAble>
,Edge
,ExternalIdAble
,GraphEntity
,IdAble
,ManagedId
,Serializable
- All Known Subinterfaces:
ConnectoidEdge
,Link
,ServiceLeg
- All Known Implementing Classes:
ConnectoidEdgeImpl
,DirectedEdgeImpl
,LinkImpl
,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 default 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
hasEdgeSegmentAb()
Verify if edge segment BA existsdefault boolean
hasEdgeSegmentBa()
Verify if edge segment BA existsEdgeSegment
registerEdgeSegment(EdgeSegment edgeSegment, boolean directionAB)
Register EdgeSegment.void
replace(EdgeSegment edgeSegmentToReplace, EdgeSegment edgeSegmentToReplaceWith)
replace passed in edge segment (if present) with the passed in one-
Methods inherited from interface org.goplanit.utils.graph.Edge
addInputProperty, clone, createEnvelope, getGeometry, getIdClass, getInputProperty, getLengthKm, getName, hasGeometry, hasName, hasVertex, isGeometryInAbDirection, removeVertex, replace, setGeometry, setLengthKm, setName, transformGeometry, validate
-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
getExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, 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
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)
-
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
-
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
-
getEdgeSegments
default Collection<? extends EdgeSegment> getEdgeSegments()
collect all edge segments available on the edge- Returns:
- available edge segments
-
-