Class Transition<T extends TransitionSymbol<T>>
- java.lang.Object
-
- it.unive.lisa.util.datastructures.automaton.Transition<T>
-
- Type Parameters:
T
- the concrete type ofTransitionSymbol
s that the transition recognizes
- All Implemented Interfaces:
java.lang.Comparable<Transition<T>>
public final class Transition<T extends TransitionSymbol<T>> extends java.lang.Object implements java.lang.Comparable<Transition<T>>
A class that describes an Automaton transition.
-
-
Constructor Summary
Constructors Constructor Description Transition(State source, State destination, T symbol)
Creates a new transition for a generic automaton.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Transition<T> transition)
boolean
equals(java.lang.Object obj)
State
getDestination()
Tells transition's destination state.State
getSource()
Tells transition's source state.T
getSymbol()
Tells input symbol forthis
transition.int
hashCode()
boolean
isEpsilonTransition()
Yieldstrue
if and only if this transition recognizes only the empty string.java.lang.String
toString()
-
-
-
Constructor Detail
-
Transition
public Transition(State source, State destination, T symbol)
Creates a new transition for a generic automaton.- Parameters:
source
- state from which the transition could be applied.destination
- state reached after the transition execution.symbol
- the character that have to be read to execute the transition.
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
isEpsilonTransition
public boolean isEpsilonTransition()
Yieldstrue
if and only if this transition recognizes only the empty string.- Returns:
true
if and only if that condition holds
-
getSource
public State getSource()
Tells transition's source state.- Returns:
- source of
this
transition.
-
getSymbol
public T getSymbol()
Tells input symbol forthis
transition.- Returns:
- symbol needed to execute
this
transition.
-
getDestination
public State getDestination()
Tells transition's destination state.- Returns:
- destination of
this
transition.
-
compareTo
public int compareTo(Transition<T> transition)
- Specified by:
compareTo
in interfacejava.lang.Comparable<T extends TransitionSymbol<T>>
-
-