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 voidaddIterationElement(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.booleanisEmpty()Replies if the model contains an element to iterate one.booleanisReversedRestitution()Replies if this model restitutes the elements in a reverse order.voidremoveIterationElements(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.StringtoString()
-
-
-
Method Detail
-
isReversedRestitution
@Pure public final boolean isReversedRestitution()
Replies if this model restitutes the elements in a reverse order.If
truethis model is assumed to replies theGraphIterationElementin the reverse order than the sequence of calls toaddIterationElement(). Iffalsethis model is assumed to replies theGraphIterationElementin the same order as the sequence of calls toaddIterationElement().- Specified by:
isReversedRestitutionin interfaceGraphCourseModel<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>- Returns:
trueif reversed, otherwisefalse
-
addIterationElement
public void addIterationElement(GraphIterationElement<ST,PT> element)
Description copied from interface:GraphCourseModelAdd an element to iterate on.- Specified by:
addIterationElementin 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:GraphCourseModelReplies if the model contains an element to iterate one.- Specified by:
isEmptyin interfaceGraphCourseModel<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>- Returns:
trueif an element exists, otherwhisefalse.
-
getNextIterationElement
public GraphIterationElement<ST,PT> getNextIterationElement()
Description copied from interface:GraphCourseModelReplies the next element without removing it from the iterator list.- Specified by:
getNextIterationElementin 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:GraphCourseModelReplies the next element and removes it from the iterator list.- Specified by:
removeNextIterationElementin 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:GraphCourseModelRemove the specified iteration elements.- Specified by:
removeIterationElementsin interfaceGraphCourseModel<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>- Parameters:
elements- the elements to remove.
-
-