Package org.goplanit.utils.graph
Interface EdgeSegment
-
- All Superinterfaces:
Cloneable
,Comparable<IdAble>
,ExternalIdAble
,GraphEntity
,IdAble
,ManagedId
,Serializable
- All Known Subinterfaces:
ConnectoidSegment
,LinkSegment
,MacroscopicLinkSegment
,ServiceLegSegment
- All Known Implementing Classes:
ConnectoidSegmentImpl
,EdgeSegmentImpl
,LinkSegmentImpl
,MacroscopicLinkSegmentImpl
,ServiceLegSegmentImpl
public interface EdgeSegment extends Serializable, GraphEntity
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
-
-
Field Summary
Fields Modifier and Type Field Description static Class<EdgeSegment>
EDGE_SEGMENT_ID_CLASS
id class for generating ids
-
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 vertexdefault Class<EdgeSegment>
getIdClass()
All edges use the EDGE_SEGMENT_ID_CLASS to generate the unique internal idsDirectedEdge
getParentEdge()
Collect the parent edge of the segmentdefault String
getParentName()
verify if parent (edge) has a nameDirectedVertex
getUpstreamVertex()
Get the segment's upstream vertexdefault boolean
hasParentName()
verify if parent (edge) has a nameboolean
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
setParent(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.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
-
-
-
-
Field Detail
-
EDGE_SEGMENT_ID_CLASS
static final Class<EdgeSegment> EDGE_SEGMENT_ID_CLASS
id class for generating ids
-
-
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
-
validate
boolean validate()
validate the contents of this edge segment- Returns:
- true when valid, false otherwise
-
clone
EdgeSegment clone()
Clone the edge segment
-
setParent
void setParent(DirectedEdge parentEdge)
Set the parent edge- Parameters:
parentEdge
- to set
-
getIdClass
default Class<EdgeSegment> getIdClass()
All edges use the EDGE_SEGMENT_ID_CLASS to generate the unique internal ids- Specified by:
getIdClass
in interfaceManagedId
- Returns:
- idClass to use for generating ids for instances of this idable derived class
-
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
-
hasParentName
default boolean hasParentName()
verify if parent (edge) has a name- Returns:
- true when present, false otherwise
-
getParentName
default String getParentName()
verify if parent (edge) has a name- Returns:
- true when present, false otherwise
-
-