ides.api.plugin.model
Class ModelManager

java.lang.Object
  extended by ides.api.plugin.model.ModelManager

public class ModelManager
extends java.lang.Object

The manager of model types available to IDES. This allows for custom model types implemented by plugins.

Author:
Lenko Grigorov
See Also:
DESModelType, registerModel(DESModelType)

Field Summary
protected  java.util.Hashtable<java.lang.Class<?>,java.util.Set<DESModelType>> class2Type
          Index of all registered DESModelTypes.
 
Method Summary
 java.lang.Object clone()
           
 DESEventSet createEmptyEventSet()
          Creates an empty event set.
<T> T
createModel(java.lang.Class<T> perspective)
          Creates and returns a DES model for the supplied perspective, e.g., FSAModel, with an empty display name.
<T> T
createModel(java.lang.Class<T> perspective, java.lang.String name)
          Creates and returns a DES model for the supplied perspective, e.g., FSAModel, with the given display name.
 DESModelType[] getAllTypes()
          Returns all model types registered with the manager.
 DESModelType[] getModelsForPerspective(java.lang.Class<?> perspective)
          Returns all model types that implement the given perspective.
static ModelManager instance()
          Provides access to the instance of the manager.
 void registerModel(DESModelType mt)
          Registers a model type so that the corresponding DES model type becomes available to IDES.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

class2Type

protected java.util.Hashtable<java.lang.Class<?>,java.util.Set<DESModelType>> class2Type
Index of all registered DESModelTypes. The key is a DES model perspective. The value is the set of the model types implementing the given perspective. Note that if a model type implements a number of perspectives, its model type will be included in the set for each one of these perspectives.

See Also:
registerModel(DESModelType)
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

instance

public static ModelManager instance()
Provides access to the instance of the manager.

Returns:
the model manager

createModel

public <T> T createModel(java.lang.Class<T> perspective,
                         java.lang.String name)
Creates and returns a DES model for the supplied perspective, e.g., FSAModel, with the given display name.

Parameters:
perspective - the perspective for which a model has to be created
name - the display name for the new model
Returns:
a new DES model for the given perspective. If no model was registered for this perspective, returns null.
See Also:
createModel(Class)

createModel

public <T> T createModel(java.lang.Class<T> perspective)
Creates and returns a DES model for the supplied perspective, e.g., FSAModel, with an empty display name.

Parameters:
perspective - the perspectivee for which a model has to be created
Returns:
a new DES model for the given perspective. If no model was registered for this perspective, returns null.
See Also:
createModel(Class, String)

getModelsForPerspective

public DESModelType[] getModelsForPerspective(java.lang.Class<?> perspective)
Returns all model types that implement the given perspective.

Parameters:
perspective - the perspective for which model types should be returned
Returns:
the model types that implement the perspective
See Also:
getAllTypes()

getAllTypes

public DESModelType[] getAllTypes()
Returns all model types registered with the manager.

Returns:
all model types registerd with the manager
See Also:
getModelsForPerspective(Class)

registerModel

public void registerModel(DESModelType mt)
Registers a model type so that the corresponding DES model type becomes available to IDES.

Parameters:
mt - the model type for the DES model

createEmptyEventSet

public DESEventSet createEmptyEventSet()
Creates an empty event set.

Returns:
an empty event set