net.digger:state-machine

A state machine implementation.

Лицензия

Лицензия

Категории

Категории

Сеть
Группа

Группа

net.digger
Идентификатор

Идентификатор

state-machine
Последняя версия

Последняя версия

1.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

net.digger:state-machine
A state machine implementation.
Ссылка на сайт

Ссылка на сайт

https://github.com/diggernet/StateMachine
Система контроля версий

Система контроля версий

https://github.com/diggernet/StateMachine/tree/develop

Скачать state-machine

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/net.digger/state-machine/ -->
<dependency>
    <groupId>net.digger</groupId>
    <artifactId>state-machine</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/net.digger/state-machine/
implementation 'net.digger:state-machine:1.0.0'
// https://jarcasting.com/artifacts/net.digger/state-machine/
implementation ("net.digger:state-machine:1.0.0")
'net.digger:state-machine:jar:1.0.0'
<dependency org="net.digger" name="state-machine" rev="1.0.0">
  <artifact name="state-machine" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.digger', module='state-machine', version='1.0.0')
)
libraryDependencies += "net.digger" % "state-machine" % "1.0.0"
[net.digger/state-machine "1.0.0"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

StateMachine

StateMachine is a Java implementation of a state machine. It was inspired by the state machine in Joshua Haberman's vtparse.

Maven configuration

	<dependency>
		<groupId>net.digger</groupId>
		<artifactId>state-machine</artifactId>
		<version>1.0.0</version>
	</dependency>

Usage

  • Extend the StateMachine class, providing enums for Action and State, and your Event type.
  • Instantiate your class, providing and initial State and an Action handler.
  • Call addState() to create states, providing a State, optional entry and exit Actions, and an initialization callback. The callback will receive an instance of StateData, which is can use to add events to the state using addEvent(), providing an Event, an optional Action to take, and an optional State to transition to.
  • When initialization is complete, you can use handleEvent() to process each Event, which will call your Action handler as appropriate.
  • You can also call reset() to reset the state machine to its initial condition, or getDOT() to retrieve the current state machine as a DOT string, suitable for rendering with Graphviz.

VTParser is implemented using StateMachine.

License

StateMachine is provided under the terms of the GNU LGPLv3.

Версии библиотеки

Версия
1.0.0