Code Examples
A repository of 155 code examples for BeepBeep
finitestatemachines.SimpleMooreMachineCompact Class Reference

Similar to SimpleMooreMachine, but with a bit of code written to avoid repetitions. More...

Static Public Member Functions

static void main (String[] args)
 

Static Protected Member Functions

static void addTransition (MooreMachine m, int source, String label, int destination)
 Adds a new transition to a Moore machine. More...
 

Detailed Description

Similar to SimpleMooreMachine, but with a bit of code written to avoid repetitions.

See also
SimpleMooreMachine::main(String[])
Author
Sylvain Hallé

Definition at line 38 of file SimpleMooreMachineCompact.java.

Member Function Documentation

◆ addTransition()

static void finitestatemachines.SimpleMooreMachineCompact.addTransition ( MooreMachine  m,
int  source,
String  label,
int  destination 
)
staticprotected

Adds a new transition to a Moore machine.

The condition on this transition is an equality check between a String event and a predefined label.

Parameters
mThe machine to add the transition to
sourceThe source state
labelThe label to compare the event to
destinationThe destination state

Definition at line 92 of file SimpleMooreMachineCompact.java.

93  {
94  m.addTransition(source, new FunctionTransition(new FunctionTree(Equals.instance, new StreamVariable(), new Constant(label)), destination));
95  }

The documentation for this class was generated from the following file: