Package it.univr.wordautomata.backend
Class PathFinder
java.lang.Object
it.univr.wordautomata.backend.PathFinder
The PathFinder class is responsible for finding a path in a graph based on a
given word.
It uses a depth-first search algorithm to traverse the graph and find a path
that matches the word.
The class provides methods to retrieve the path, check if the entire word was
consumed, and check if the path ended on a final state.
-
Property Summary
TypePropertyDescriptionstatic javafx.beans.property.SimpleBooleanProperty
Tells if the entire word was consumed.static javafx.beans.property.SimpleBooleanProperty
Tells if the path ended on a final state. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Clears the properties of the PathFinder.static javafx.beans.property.SimpleBooleanProperty
Tells if the entire word was consumed.static javafx.beans.property.SimpleBooleanProperty
Tells if the path ended on a final state.static List
<com.brunomnsilva.smartgraph.graph.Edge<Transition, State>> Finds a path in the graph that matches the given wordstatic List
<com.brunomnsilva.smartgraph.graph.Edge<Transition, State>> getPath
(String word, com.brunomnsilva.smartgraph.graph.DigraphEdgeList<State, Transition> graph) Finds a path in the graph that matches the given word.
-
Property Details
-
consumedAllWord
public static javafx.beans.property.SimpleBooleanProperty consumedAllWordPropertyTells if the entire word was consumed.- See Also:
-
endedOnFinalState
public static javafx.beans.property.SimpleBooleanProperty endedOnFinalStatePropertyTells if the path ended on a final state.- See Also:
-
-
Constructor Details
-
PathFinder
public PathFinder()
-
-
Method Details
-
getPath
public static List<com.brunomnsilva.smartgraph.graph.Edge<Transition,State>> getPath(String word, com.brunomnsilva.smartgraph.graph.DigraphEdgeList<State, Transition> graph) Finds a path in the graph that matches the given word.- Parameters:
word
- The word to find a path for.graph
- The graph to search- Returns:
- A list of edges representing the path if found, or null if no path is found.
-
getPath
Finds a path in the graph that matches the given word- Parameters:
word
- he word to find a path for.- Returns:
- A list of edges representing the path if found, or null if no path is found.
-
consumedAllWordProperty
public static javafx.beans.property.SimpleBooleanProperty consumedAllWordProperty()Tells if the entire word was consumed.- Returns:
- the
consumedAllWord
property
-
endedOnFinalStateProperty
public static javafx.beans.property.SimpleBooleanProperty endedOnFinalStateProperty()Tells if the path ended on a final state.- Returns:
- the
endedOnFinalState
property
-
clearProperties
public static void clearProperties()Clears the properties of the PathFinder.
-