|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.malai.interaction.State
public abstract class State
A state is a component of 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.
10/10/2010
Field Summary | |
---|---|
protected java.lang.String |
name
The name of the state. |
protected Interaction |
stateMachine
The state machine that contains the state. |
protected java.util.List<ITransition> |
transitions
The list of the transitions that leave the state. |
Constructor Summary | |
---|---|
State(java.lang.String name)
Creates the state. |
Method Summary | |
---|---|
void |
addTransition(ITransition trans)
Adds a transition to the state. |
java.lang.String |
getName()
|
Interaction |
getStateMachine()
|
ITransition |
getTransition(int i)
|
java.util.List<ITransition> |
getTransitions()
|
void |
setStateMachine(IStateMachine sm)
Sets the state machine of the state. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String name
protected java.util.List<ITransition> transitions
protected Interaction stateMachine
Constructor Detail |
---|
public State(java.lang.String name)
name
- The name of the state.
java.lang.IllegalArgumentException
- If the given name is null.Method Detail |
---|
public void setStateMachine(IStateMachine sm)
IState
setStateMachine
in interface IState
sm
- The new state machine. If null, nothing is done.public Interaction getStateMachine()
getStateMachine
in interface IState
public void addTransition(ITransition trans)
IState
addTransition
in interface IState
trans
- The new transition. Must not be null.public java.lang.String getName()
getName
in interface IState
public java.util.List<ITransition> getTransitions()
getTransitions
in interface IState
public ITransition getTransition(int i)
getTransition
in interface IState
i
- The position of the transition to get.
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |