Package org.arakhne.afc.math.graph
Class BreadthFirstGraphCourseModel<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>
- java.lang.Object
-
- org.arakhne.afc.math.graph.BreadthFirstGraphCourseModel<ST,PT>
-
- Type Parameters:
PT
- is the type of node in the graphST
- is the type of edge in the graph
- All Implemented Interfaces:
GraphCourseModel<ST,PT>
public class BreadthFirstGraphCourseModel<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>> extends Object implements GraphCourseModel<ST,PT>
This class permits to implement a breadth-first algorithm to make a course inside 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
-
-
Constructor Summary
Constructors Constructor Description BreadthFirstGraphCourseModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addIterationElement(GraphIterationElement<ST,PT> element)
Add an element to iterate on.GraphIterationElement<ST,PT>
getNextIterationElement()
Replies the next element without removing it from the iterator list.boolean
isEmpty()
Replies if the model contains an element to iterate one.boolean
isReversedRestitution()
Replies if this model restitutes the elements in a reverse order.void
removeIterationElements(Iterable<GraphIterationElement<ST,PT>> elements)
Remove the specified iteration elements.GraphIterationElement<ST,PT>
removeNextIterationElement()
Replies the next element and removes it from the iterator list.String
toString()
-
-
-
Method Detail
-
isReversedRestitution
@Pure public final boolean isReversedRestitution()
Replies if this model restitutes the elements in a reverse order.If
true
this model is assumed to replies theGraphIterationElement
in the reverse order than the sequence of calls toaddIterationElement()
. Iffalse
this model is assumed to replies theGraphIterationElement
in the same order as the sequence of calls toaddIterationElement()
.- Specified by:
isReversedRestitution
in interfaceGraphCourseModel<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>
- Returns:
true
if reversed, otherwisefalse
-
addIterationElement
public void addIterationElement(GraphIterationElement<ST,PT> element)
Description copied from interface:GraphCourseModel
Add an element to iterate on.- Specified by:
addIterationElement
in interfaceGraphCourseModel<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>
- Parameters:
element
- is the element which could be the result of a future iteration.
-
isEmpty
@Pure public boolean isEmpty()
Description copied from interface:GraphCourseModel
Replies if the model contains an element to iterate one.- Specified by:
isEmpty
in interfaceGraphCourseModel<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>
- Returns:
true
if an element exists, otherwhisefalse
.
-
getNextIterationElement
public GraphIterationElement<ST,PT> getNextIterationElement()
Description copied from interface:GraphCourseModel
Replies the next element without removing it from the iterator list.- Specified by:
getNextIterationElement
in interfaceGraphCourseModel<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>
- Returns:
- the next element
-
removeNextIterationElement
public GraphIterationElement<ST,PT> removeNextIterationElement()
Description copied from interface:GraphCourseModel
Replies the next element and removes it from the iterator list.- Specified by:
removeNextIterationElement
in interfaceGraphCourseModel<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>
- Returns:
- the next element
-
removeIterationElements
public void removeIterationElements(Iterable<GraphIterationElement<ST,PT>> elements)
Description copied from interface:GraphCourseModel
Remove the specified iteration elements.- Specified by:
removeIterationElements
in interfaceGraphCourseModel<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>
- Parameters:
elements
- the elements to remove.
-
-