Package org.planit.utils.graph
Interface EdgeSegment
-
- All Superinterfaces:
Comparable<Idable>
,ExternalIdable
,Idable
,Serializable
- All Known Subinterfaces:
ConnectoidSegment
,LinkSegment
,MacroscopicLinkSegment
- All Known Implementing Classes:
ConnectoidSegmentImpl
,EdgeSegmentImpl
,LinkSegmentImpl
,MacroscopicLinkSegmentImpl
public interface EdgeSegment extends Serializable, ExternalIdable
EdgeSegment represents an edge in a particular (single) direction. Each edge has either one or two edge segments where each edge segment may have a more detailed geography than its parent edge- Author:
- markr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description EdgeSegment
clone()
Clone the edge segmentDirectedVertex
getDownstreamVertex()
Get the segment's downstream vertexDirectedEdge
getParentEdge()
Collect the parent edge of the segmentDirectedVertex
getUpstreamVertex()
Get the segment's upstream vertexboolean
isDirectionAb()
check if edge segment runs from vertex a to b or b to aboolean
remove(DirectedVertex vertex)
Remove the vertex from the edge segment if it is either the up or downstream vertexvoid
removeParentEdge()
remove the parent edge from this edge segmentdefault boolean
replace(DirectedVertex vertexToReplace, DirectedVertex vertexToReplaceWith)
Replace one of the vertices of the edge segmentvoid
setDownstreamVertex(DirectedVertex vertexToReplaceWith)
Set another downstream vertex.void
setParentEdge(DirectedEdge parentEdge)
Set the parent edgevoid
setUpstreamVertex(DirectedVertex vertexToReplaceWith)
Set another upstream vertex.boolean
validate()
validate the contents of this edge segment-
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
-
remove
boolean remove(DirectedVertex vertex)
Remove the vertex from the edge segment if it is either the up or downstream vertex- Parameters:
vertex
- to remove- Returns:
- true when successful, false otherwise
-
setUpstreamVertex
void setUpstreamVertex(DirectedVertex vertexToReplaceWith)
Set another upstream vertex.- Parameters:
vertexToReplaceWith
- to use
-
getUpstreamVertex
DirectedVertex getUpstreamVertex()
Get the segment's upstream vertex- Returns:
- upstream vertex
-
getDownstreamVertex
DirectedVertex getDownstreamVertex()
Get the segment's downstream vertex- Returns:
- downstream vertex
-
setDownstreamVertex
void setDownstreamVertex(DirectedVertex vertexToReplaceWith)
Set another downstream vertex.- Parameters:
vertexToReplaceWith
- to use
-
getParentEdge
DirectedEdge getParentEdge()
Collect the parent edge of the segment- Returns:
- parentEdge
-
removeParentEdge
void removeParentEdge()
remove the parent edge from this edge segment
-
isDirectionAb
boolean isDirectionAb()
check if edge segment runs from vertex a to b or b to a- Returns:
- true when running from a to b, otherwise false
-
replace
default boolean replace(DirectedVertex vertexToReplace, DirectedVertex vertexToReplaceWith)
Replace one of the vertices of the edge segment- Parameters:
vertexToReplace
- the vertex to replacevertexToReplaceWith
- the vertex to replace with- Returns:
- true when replaced, false otherwise
-
validate
boolean validate()
validate the contents of this edge segment- Returns:
- true when valid, false otherwise
-
clone
EdgeSegment clone()
Clone the edge segment- Returns:
- copy of this instance
-
setParentEdge
void setParentEdge(DirectedEdge parentEdge)
Set the parent edge- Parameters:
parentEdge
- to set
-
-