Record Class ExecutionStep

java.lang.Object
java.lang.Record
it.tugamer89.autogex.trace.ExecutionStep
Record Components:
fromStates - The set of active states before reading the symbol.
symbolRead - The input symbol read during this step (null represents an epsilon transition).
toStates - The set of active states reached after evaluating the symbol.

public record ExecutionStep(Set<State> fromStates, Character symbolRead, Set<State> toStates) extends Record
Represents a single evaluation step within an automaton's execution trace. Maintains immutability utilizing Java Records.
  • Constructor Details

    • ExecutionStep

      public ExecutionStep(Set<State> fromStates, Character symbolRead, Set<State> toStates)
      Creates an instance of a ExecutionStep record class.
      Parameters:
      fromStates - the value for the fromStates record component
      symbolRead - the value for the symbolRead record component
      toStates - the value for the toStates record component
  • Method Details

    • toString

      public String toString()
      Formats the execution step into a highly readable mathematical string. Example: {q0, q1} --[a]--> {q2}
      Specified by:
      toString in class Record
      Returns:
      The formatted trace string.
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • fromStates

      public Set<State> fromStates()
      Returns the value of the fromStates record component.
      Returns:
      the value of the fromStates record component
    • symbolRead

      public Character symbolRead()
      Returns the value of the symbolRead record component.
      Returns:
      the value of the symbolRead record component
    • toStates

      public Set<State> toStates()
      Returns the value of the toStates record component.
      Returns:
      the value of the toStates record component