com.evelopers.unimod.core.stateworks
Class Model

java.lang.Object
  extended bycom.evelopers.unimod.core.ModelElement
      extended bycom.evelopers.unimod.core.stateworks.Model
All Implemented Interfaces:
java.io.Serializable

public class Model
extends ModelElement

Represents behaviour model. Model contains set of state machines, set of controlled object handers and set of event provider handlers. Model knows about root state machine. Do not put instances of this class into hashCode aware containters like HashSet.

Implements factory for Model, EventProviderHandler, ControlledObjectHandler, StateMachine.

See Also:
Serialized Form

Field Summary
static java.lang.String CHILDREN_PROPERTY
           
protected  java.util.List controlledObjectHandlers
           
protected  java.util.List eventProviderHandlers
           
protected  StateMachine root
           
static java.lang.String ROOT_STATE_MACHINE
           
protected  java.util.List stateMachines
           
 
Fields inherited from class com.evelopers.unimod.core.ModelElement
listeners, name, NAME_PROPERTY, stereotype, STEREOTYPE_PROPERTY
 
Constructor Summary
protected Model(java.lang.String name)
           
 
Method Summary
protected  void addControlledObjectHandler(ControlledObjectHandler object)
           
protected  void addEventProviderHandler(EventProviderHandler object)
           
protected  void addStateMachine(StateMachine machine)
           
 ControlledObjectHandler createControlledObjectHandler(java.lang.String name, java.lang.String implClassName)
          Creates controlled object handler and adds it to model.
 EventProviderHandler createEventProviderHandler(java.lang.String name, java.lang.String implClassName)
          Creates event provider handler and adds it to model.
static Model createModel(java.lang.String name)
          Creates new model
 StateMachine createStateMachine(java.lang.String name)
          Creates state machine with given name and adds it to model.
 boolean equals(java.lang.Object o)
          Compare with another model element.
protected  ModelElement find(java.util.Collection c, java.lang.String name)
           
 ControlledObjectHandler getControlledObjectHandler(java.lang.String name)
          Returns first found controlled object handler with given name
 java.util.List getControlledObjectHandlers()
           
 EventProviderHandler getEventProviderHandler(java.lang.String name)
          Returns first found event provider handler with given name
 java.util.List getEventProviderHandlers()
           
 StateMachine getRootStateMachine()
           
 StateMachine getStateMachine(java.lang.String name)
          Returns first found state machine with given name
 java.util.List getStateMachines()
           
 int hashCode()
          Returns model element hash code.
protected  void removeControlledObjectHandler(ControlledObjectHandler co)
           
protected  void removeEventProviderHandler(EventProviderHandler ep)
           
protected  void removeStateMachine(StateMachine co)
           
 void setRootStateMachine(StateMachine root)
           
 
Methods inherited from class com.evelopers.unimod.core.ModelElement
accept, addPropertyChangeListener, firePropertyChange, getName, getStereotype, initListeners, removePropertyChangeListener, setName, setStereotype, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CHILDREN_PROPERTY

public static final java.lang.String CHILDREN_PROPERTY
See Also:
Constant Field Values

ROOT_STATE_MACHINE

public static final java.lang.String ROOT_STATE_MACHINE
See Also:
Constant Field Values

stateMachines

protected java.util.List stateMachines

controlledObjectHandlers

protected java.util.List controlledObjectHandlers

eventProviderHandlers

protected java.util.List eventProviderHandlers

root

protected StateMachine root
Constructor Detail

Model

protected Model(java.lang.String name)
Method Detail

addStateMachine

protected void addStateMachine(StateMachine machine)

addControlledObjectHandler

protected void addControlledObjectHandler(ControlledObjectHandler object)

addEventProviderHandler

protected void addEventProviderHandler(EventProviderHandler object)

setRootStateMachine

public void setRootStateMachine(StateMachine root)

find

protected ModelElement find(java.util.Collection c,
                            java.lang.String name)

getControlledObjectHandler

public ControlledObjectHandler getControlledObjectHandler(java.lang.String name)
Returns first found controlled object handler with given name

Parameters:
name -
Returns:

getStateMachine

public StateMachine getStateMachine(java.lang.String name)
Returns first found state machine with given name

Parameters:
name -
Returns:

getEventProviderHandler

public EventProviderHandler getEventProviderHandler(java.lang.String name)
Returns first found event provider handler with given name

Parameters:
name -
Returns:

getControlledObjectHandlers

public java.util.List getControlledObjectHandlers()

getEventProviderHandlers

public java.util.List getEventProviderHandlers()

getRootStateMachine

public StateMachine getRootStateMachine()

getStateMachines

public java.util.List getStateMachines()

removeControlledObjectHandler

protected void removeControlledObjectHandler(ControlledObjectHandler co)

removeStateMachine

protected void removeStateMachine(StateMachine co)

removeEventProviderHandler

protected void removeEventProviderHandler(EventProviderHandler ep)

equals

public boolean equals(java.lang.Object o)
Description copied from class: ModelElement
Compare with another model element.

Specified by:
equals in class ModelElement
Parameters:
o - another model element
Returns:
boolean

hashCode

public int hashCode()
Description copied from class: ModelElement
Returns model element hash code.

Specified by:
hashCode in class ModelElement
Returns:
hash code

createModel

public static Model createModel(java.lang.String name)
Creates new model

Parameters:
name - model name

createStateMachine

public StateMachine createStateMachine(java.lang.String name)
Creates state machine with given name and adds it to model.

Parameters:
name - state machine name
Returns:
newly created state machine

createControlledObjectHandler

public ControlledObjectHandler createControlledObjectHandler(java.lang.String name,
                                                             java.lang.String implClassName)
Creates controlled object handler and adds it to model. Doesn't try to instanciate implementation class. So may be called even if there's no impl class yet (during design phase, for example).

Parameters:
name - controlled object handler name
implClassName - controlled object implementation class name
Returns:
newly created object

createEventProviderHandler

public EventProviderHandler createEventProviderHandler(java.lang.String name,
                                                       java.lang.String implClassName)
Creates event provider handler and adds it to model.

Parameters:
name - provider name
implClassName - fully quialified implementation class name
Returns: