Package org.arakhne.afc.math.graph
Interface Graph<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>
-
- Type Parameters:
PT
- is the type of node in the graphST
- is the type of edge in the graph
- All Superinterfaces:
Iterable<ST>
- All Known Subinterfaces:
RoadNetwork
,RoadSegmentContainer
- All Known Implementing Classes:
SGraph
,StandardRoadNetwork
,SubGraph
,SubRoadNetwork
public interface Graph<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>> extends Iterable<ST>
This interface representes a graph.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:42
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgraph
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
contains(Object obj)
Replies is this graph contains the given segment.default GraphIterator<ST,PT>
depthIterator(ST startingSegment, double depth, double positionFromStartingPoint, PT startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments)
Replies an iterator that permits to move along the segment's graph starting from the specified segment and from the specified starting point.GraphIterator<ST,PT>
depthIterator(ST startingSegment, double depth, double positionFromStartingPoint, PT startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments, DynamicDepthUpdater<ST,PT> dynamicDepthUpdater)
Replies an iterator that permits to move along the segment's graph starting from the specified segment and from the specified starting point.int
getPointCount()
Replies the count of points in this graph.int
getSegmentCount()
Replies the count of segments in this graph.boolean
isEmpty()
Replies if this graph is empty or not.GraphIterator<ST,PT>
iterator(ST startingSegment, PT startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments)
Replies an iterator that permits to move along the road segment's graph starting from this road segment and from the specified starting point.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
getSegmentCount
@Pure int getSegmentCount()
Replies the count of segments in this graph.- Returns:
- the count of segments in this graph.
-
getPointCount
@Pure int getPointCount()
Replies the count of points in this graph.- Returns:
- the count of points in this graph.
-
isEmpty
@Pure boolean isEmpty()
Replies if this graph is empty or not.- Returns:
true
if the graph is empty, otherwisefalse
.
-
contains
@Pure boolean contains(Object obj)
Replies is this graph contains the given segment. The test is based onObject.equals(Object)
.- Parameters:
obj
- the object to search for.- Returns:
true
if the graph contains the segment, otherwisefalse
.
-
iterator
@Pure GraphIterator<ST,PT> iterator(ST startingSegment, PT startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments)
Replies an iterator that permits to move along the road segment's graph starting from this road segment and from the specified starting point.- Parameters:
startingSegment
- is the first segment to iterate.startingPoint
- is the starting point of the iterations.allowManyReplies
- may betrue
to allow to reply many times the same segment, otherwhisefalse
.assumeOrientedSegments
- may betrue
to assume that the same segment has two different instances for graph iteration: the first instance is associated the first point of the segment and the second instance is associated to the last point of the segment. If this parameter isfalse
to assume that the end points of a segment are not distinguished.- Returns:
- the iterator.
-
depthIterator
@Pure default GraphIterator<ST,PT> depthIterator(ST startingSegment, double depth, double positionFromStartingPoint, PT startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments)
Replies an iterator that permits to move along the segment's graph starting from the specified segment and from the specified starting point. If the specified starting point is not one of the ends of the segment, this function assumes to start from the point replied byGraphSegment.getBeginPoint()
.This function does not allow the cycles during the iterations.
- Parameters:
startingSegment
- is the first segment to iterate.depth
- is the maximal depth to reach.positionFromStartingPoint
- is the starting position from thestartingPoint
.startingPoint
- is the starting point of the iterations.allowManyReplies
- may betrue
to allow to reply many times the same segment, otherwhisefalse
.assumeOrientedSegments
- may betrue
to assume that the same segment has two different instances for graph iteration: the first instance is associated the first point of the segment and the second instance is associated to the last point of the segment. If this parameter isfalse
to assume that the end points of a segment are not distinguished.- Returns:
- the iterator.
- See Also:
depthIterator(GraphSegment, double, double, GraphPoint, boolean, boolean, DynamicDepthUpdater)
-
depthIterator
@Pure GraphIterator<ST,PT> depthIterator(ST startingSegment, double depth, double positionFromStartingPoint, PT startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments, DynamicDepthUpdater<ST,PT> dynamicDepthUpdater)
Replies an iterator that permits to move along the segment's graph starting from the specified segment and from the specified starting point. If the specified starting point is not one of the ends of the segment, this function assumes to start from the point replied byGraphSegment.getBeginPoint()
.This function does not allow the cycles during the iterations.
- Parameters:
startingSegment
- is the first segment to iterate.depth
- is the maximal depth to reach.positionFromStartingPoint
- is the starting position from thestartingPoint
.startingPoint
- is the starting point of the iterations.allowManyReplies
- may betrue
to allow to reply many times the same segment, otherwhisefalse
.assumeOrientedSegments
- may betrue
to assume that the same segment has two different instances for graph iteration: the first instance is associated the first point of the segment and the second instance is associated to the last point of the segment. If this parameter isfalse
to assume that the end points of a segment are not distinguished.dynamicDepthUpdater
- if notnull
, it is a lambda that is used for dynamically updating the maximal depth.- Returns:
- the iterator.
- Since:
- 16.0
- See Also:
depthIterator(GraphSegment, double, double, GraphPoint, boolean, boolean)
-
-