Package org.planit.utils.graph
Interface DirectedEdge
-
- All Superinterfaces:
Comparable<Idable>
,Edge
,ExternalIdable
,Idable
,Serializable
- All Known Subinterfaces:
ConnectoidEdge
,Link
- All Known Implementing Classes:
ConnectoidEdgeImpl
,DirectedEdgeImpl
,LinkImpl
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
-
-
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 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.planit.utils.graph.Edge
addInputProperty, clone, getGeometry, getInputProperty, getLengthKm, getName, getVertexA, getVertexB, hasGeometry, hasVertex, isGeometryInAbDirection, removeVertex, replace, setGeometry, setLengthKm, setName, transformGeometry, validate
-
Methods inherited from interface org.planit.utils.id.ExternalIdable
getExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId
-
Methods inherited from interface org.planit.utils.id.Idable
compareTo, getId, idEquals, idHashCode
-
-
-
-
Method Detail
-
registerEdgeSegment
EdgeSegment registerEdgeSegment(EdgeSegment edgeSegment, boolean directionAB) throws PlanItException
Register EdgeSegment. If there already exists an edgeSegment for that direction it is replaced and returned- Parameters:
edgeSegment
- the edgeSegment to be registereddirectionAB
- direction of travel- Returns:
- replaced egeSegment (if any)
- Throws:
PlanItException
- thrown if there is an error
-
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
-
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
-
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
-
-