org.malai.stateMachine
Interface IState

All Known Subinterfaces:
SourceableState, TargetableState
All Known Implementing Classes:
AbortingState, InitState, IntermediaryState, State, TerminalState

public interface IState

This interface defines the notion of state that composes a state machine.

This file is part of Malai.
Copyright (c) 2009-2012 Arnaud BLOUIN

Malai is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Malai is distributed without any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

11/03/2010

Since:
0.2
Version:
0.2
Author:
Arnaud BLOUIN

Method Summary
 void addTransition(ITransition trans)
          Adds a transition to the state.
 java.lang.String getName()
           
 IStateMachine getStateMachine()
           
 ITransition getTransition(int index)
           
 java.util.List<ITransition> getTransitions()
           
 void setStateMachine(IStateMachine sm)
          Sets the state machine of the state.
 

Method Detail

addTransition

void addTransition(ITransition trans)
Adds a transition to the state.

Parameters:
trans - The new transition. Must not be null.
Since:
0.1

getName

java.lang.String getName()
Returns:
The name of the state.
Since:
0.1

getTransitions

java.util.List<ITransition> getTransitions()
Returns:
The transitions that leaves the state.
Since:
0.1

getTransition

ITransition getTransition(int index)
Parameters:
index - The position of the transition to get.
Returns:
The corresponding transition or null if the given index is not valid.
Since:
0.2

setStateMachine

void setStateMachine(IStateMachine sm)
Sets the state machine of the state.

Parameters:
sm - The new state machine. If null, nothing is done.
Since:
0.2

getStateMachine

IStateMachine getStateMachine()
Returns:
The state machine that contains the state.
Since:
0.2