Package org.arakhne.afc.math.graph
Class DepthGraphIterator<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>
- java.lang.Object
-
- org.arakhne.afc.math.graph.GraphIterator<ST,PT>
-
- org.arakhne.afc.math.graph.DepthGraphIterator<ST,PT>
-
- Type Parameters:
PT
- is the type of node in the graphST
- is the type of edge in the graph
- All Implemented Interfaces:
Iterator<ST>
- Direct Known Subclasses:
DistanceBasedRoadNetworkIterator
public class DepthGraphIterator<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>> extends GraphIterator<ST,PT>
This class is an iterator on the segments limited to a specified depth.The behaviour of the iterator is strongly influenced by the constructor's parameters. One of the most important parameter is
assumeOrientedSegments
. TheassumeOrientedSegments
parameter indicates how the segments are considered by the iterator. IfassumeOrientedSegments
istrue
it means that a segment reached by one of its end point is different than the same segment reached by the other end point. IfassumeOrientedSegments
isfalse
it means that the end points of the segments are not take into account.- 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
-
-
Field Summary
-
Fields inherited from class org.arakhne.afc.math.graph.GraphIterator
dynamicDepthUpdater
-
-
Constructor Summary
Constructors Constructor Description DepthGraphIterator(Graph<ST,PT> graph, double depth, double positionFromStartingPoint, ST segment, PT startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments)
Deprecated, for removal: This API element is subject to removal in a future version.since 16.0DepthGraphIterator(Graph<ST,PT> graph, double depth, double positionFromStartingPoint, ST segment, PT startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments, DynamicDepthUpdater<ST,PT> dynamicDepthUpdater)
Constructor.DepthGraphIterator(Graph<ST,PT> graph, double depth, ST segment, PT startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments)
Deprecated, for removal: This API element is subject to removal in a future version.since 16.0DepthGraphIterator(Graph<ST,PT> graph, double depth, ST segment, PT startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments, DynamicDepthUpdater<ST,PT> dynamicDepthUpdater)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canGotoIntoElement(GraphIterationElement<ST,PT> element)
Replies if the specified element could be added into the list of futher elements.-
Methods inherited from class org.arakhne.afc.math.graph.GraphIterator
clear, createVisitedSegmentComparator, getGraph, getNextElement, getNextSegments, hasNext, ignoreElementsAfter, ignoreElementsAfter, isManySegmentReplyEnabled, isOrientedSegmentSupportEnabled, newIterationElement, next, nextElement, remove
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
DepthGraphIterator
@Deprecated(since="16.0", forRemoval=true) public DepthGraphIterator(Graph<ST,PT> graph, double depth, double positionFromStartingPoint, ST segment, PT startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments)
Deprecated, for removal: This API element is subject to removal in a future version.since 16.0Constructor.- Parameters:
graph
- is the graph associated to this iterator.depth
- is the maximal depth to reach (in the metric coordiante system).positionFromStartingPoint
- is the starting position from thestarting_point
(in meters).segment
- is the segment from which to start.startingPoint
- is the segment's point indicating the direction.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.
-
DepthGraphIterator
public DepthGraphIterator(Graph<ST,PT> graph, double depth, double positionFromStartingPoint, ST segment, PT startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments, DynamicDepthUpdater<ST,PT> dynamicDepthUpdater)
Constructor.- Parameters:
graph
- is the graph associated to this iterator.depth
- is the maximal depth to reach (in the metric coordiante system).positionFromStartingPoint
- is the starting position from thestarting_point
(in meters).segment
- is the segment from which to start.startingPoint
- is the segment's point indicating the direction.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 used to dynamically update the depth.
-
DepthGraphIterator
@Deprecated(since="16.0", forRemoval=true) public DepthGraphIterator(Graph<ST,PT> graph, double depth, ST segment, PT startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments)
Deprecated, for removal: This API element is subject to removal in a future version.since 16.0Constructor.- Parameters:
graph
- is the graph associated to this iterator.depth
- is the maximal depth to reach (in the metric coordiante system).segment
- is the segment from which to start.startingPoint
- is the segment's point indicating the direction.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.
-
DepthGraphIterator
public DepthGraphIterator(Graph<ST,PT> graph, double depth, ST segment, PT startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments, DynamicDepthUpdater<ST,PT> dynamicDepthUpdater)
Constructor.- Parameters:
graph
- is the graph associated to this iterator.depth
- is the maximal depth to reach (in the metric coordiante system).segment
- is the segment from which to start.startingPoint
- is the segment's point indicating the direction.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 used to dynamically update the depth.
-
-
Method Detail
-
canGotoIntoElement
@Pure protected boolean canGotoIntoElement(GraphIterationElement<ST,PT> element)
Replies if the specified element could be added into the list of futher elements.- Overrides:
canGotoIntoElement
in classGraphIterator<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>
- Parameters:
element
- the element to test.- Returns:
true
if the given element is addable into the associated list.
-
-