templates.model.v3
Class Component

java.lang.Object
  extended by templates.model.v3.Component
All Implemented Interfaces:
ides.api.core.Annotable, ides.api.plugin.model.DESElement, TemplateComponent

public class Component
extends java.lang.Object
implements TemplateComponent

Implementation of TemplateComponent.

Author:
Lenko Grigorov

Field Summary
protected  java.util.Hashtable<java.lang.String,java.lang.Object> annotations
          A map with the annotations of this element.
protected  ides.api.model.fsa.FSAModel fsa
          The FSAModel associated with the component.
protected  long id
          The id of the component.
protected  int type
          The type of the component.
 
Fields inherited from interface templates.model.TemplateComponent
TYPE_CHANNEL, TYPE_MODULE
 
Fields inherited from interface ides.api.core.Annotable
COMPOSED_OF, COMPOSED_OF_NAMES, CONTROL_MAP, FILE, LAYOUT, TEXT_ANNOTATION
 
Constructor Summary
Component(long id)
          Construct a new component with the given parameters.
 
Method Summary
 java.lang.Object getAnnotation(java.lang.String key)
           
 long getId()
           
 ides.api.model.fsa.FSAModel getModel()
          Retrieve the FSAModel associated with the component.
 int getType()
          Retrieve the type of the component.
 boolean hasAnnotation(java.lang.String key)
           
 boolean hasModel()
          Checks if there is an FSAModel associated with the component.
 void removeAnnotation(java.lang.String key)
           
 void setAnnotation(java.lang.String key, java.lang.Object annotation)
           
 void setId(long id)
           
 void setModel(ides.api.model.fsa.FSAModel fsa)
          Assign the FSAModel to be associated with the component.
 void setType(int type)
          Sets the type of the component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

annotations

protected java.util.Hashtable<java.lang.String,java.lang.Object> annotations
A map with the annotations of this element.


id

protected long id
The id of the component.


type

protected int type
The type of the component. By default is module.


fsa

protected ides.api.model.fsa.FSAModel fsa
The FSAModel associated with the component.

Constructor Detail

Component

public Component(long id)
Construct a new component with the given parameters.

Parameters:
id - the id of the component
Method Detail

getAnnotation

public java.lang.Object getAnnotation(java.lang.String key)
Specified by:
getAnnotation in interface ides.api.core.Annotable

hasAnnotation

public boolean hasAnnotation(java.lang.String key)
Specified by:
hasAnnotation in interface ides.api.core.Annotable

removeAnnotation

public void removeAnnotation(java.lang.String key)
Specified by:
removeAnnotation in interface ides.api.core.Annotable

setAnnotation

public void setAnnotation(java.lang.String key,
                          java.lang.Object annotation)
Specified by:
setAnnotation in interface ides.api.core.Annotable

getId

public long getId()
Specified by:
getId in interface ides.api.plugin.model.DESElement

setId

public void setId(long id)
Specified by:
setId in interface ides.api.plugin.model.DESElement

getModel

public ides.api.model.fsa.FSAModel getModel()
Description copied from interface: TemplateComponent
Retrieve the FSAModel associated with the component.

Specified by:
getModel in interface TemplateComponent
Returns:
the FSAModel associated with the component; null if no FSAModel is associated

hasModel

public boolean hasModel()
Description copied from interface: TemplateComponent
Checks if there is an FSAModel associated with the component.

Specified by:
hasModel in interface TemplateComponent
Returns:
true if the associated FSAModel is not null; false otherwise

setModel

public void setModel(ides.api.model.fsa.FSAModel fsa)
Description copied from interface: TemplateComponent
Assign the FSAModel to be associated with the component.

Specified by:
setModel in interface TemplateComponent
Parameters:
fsa - the FSAModel to be associated with the component

getType

public int getType()
Description copied from interface: TemplateComponent
Retrieve the type of the component.

Specified by:
getType in interface TemplateComponent
Returns:
TemplateComponent.TYPE_MODULE or TemplateComponent.TYPE_CHANNEL

setType

public void setType(int type)
Description copied from interface: TemplateComponent
Sets the type of the component.

Specified by:
setType in interface TemplateComponent
Parameters:
type - the type of the component (TemplateComponent.TYPE_MODULE or TemplateComponent.TYPE_CHANNEL)