State

class State(name: Int, isStart: Boolean = false, isAcceptingState: Boolean = false)

A simple class representing a state in an FSM.

  • name is the name of the State and must be unique for the FSM.

  • isStart indicates if it is the starting state.

  • isAcceptingState indicates if this State accepts the FSM (in our case, this means that the order of statements was correct).

Constructors

Link copied to clipboard
constructor(name: Int, isStart: Boolean = false, isAcceptingState: Boolean = false)

Properties

Link copied to clipboard

Must only be changed through FSM.changeStateProperty as soon as they are part of a FSM.

Link copied to clipboard

Must only be changed through FSM.changeStateProperty as soon as they are part of a FSM.

Link copied to clipboard
var name: Int

Must only be changed through FSM.changeStateProperty as soon as they are part of a FSM.

Link copied to clipboard

Functions

Link copied to clipboard
fun addEdge(edge: Edge)
Link copied to clipboard
fun copy(name: Int = this.name, isStart: Boolean = this.isStart, isAcceptingState: Boolean = this.isAcceptingState): State

Create a shallow copy

Link copied to clipboard
fun deepCopy(currentStates: MutableSet<State> = mutableSetOf()): MutableSet<State>
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String