pl.edu.agh.cast.model.base
Interface IEntity

All Superinterfaces:
Mappable
All Known Implementing Classes:
Entity

public interface IEntity
extends Mappable

The IEntity interface represents the model elements which are displayed in diagrams as entities (i.e. nodes or threads).

The primary attribute of a entity is its id - the identifier visible for users, by which they are able to identify it.

The IEntity has two sets of relations:

The relations may by polymorphic, i.e. given entity may be related to entities of different types (e.g. phone number may be related to other number by the call relation and may be related to person by the ownership relation). The relations should be mapped to the base model, since the default implementation of the relation interface is mapped to the base model.

The entity has also a type, whose purpose is to differentiate the way different entities are displayed (i.e. as phone icon, as smiling face, etc.)

Author:
AGH CAST Team

Method Summary
 void addRelation(IRelation relation)
          Add new relation to relations of this entity.
 String getId()
          The id of the entity (getter).
 List<IRelation> getSourceRelations()
          Source relations (getter).
 List<IRelation> getTargetRelations()
          Target relations (getter).
 boolean isConnected(IEntity entity)
          Returns true if the entity is directly connected with given entity.
 void removeRelation(IRelation relation)
          Remove relation from this entity.
 void setId(String id)
          The id of the entity (setter).
 void setSourceRelations(List<IRelation> relations)
          Source relations (setter).
 void setTargetRelations(List<IRelation> relations)
          Target relations (setter).
 
Methods inherited from interface pl.edu.agh.cast.model.mapper.Mappable
clone, getAttribute, getAttributeNames, getAttributeType, getMid, getType, setAttribute, setMid
 

Method Detail

getId

String getId()
The id of the entity (getter).

Specified by:
getId in interface Mappable
Returns:
the id

setId

void setId(String id)
The id of the entity (setter).

Specified by:
setId in interface Mappable
Parameters:
id - Id to set

addRelation

void addRelation(IRelation relation)
Add new relation to relations of this entity. The source or target of the relation must be set with object which == this.

Parameters:
relation - The relation to add

removeRelation

void removeRelation(IRelation relation)
Remove relation from this entity.

Parameters:
relation - The relation to remove.

getSourceRelations

List<IRelation> getSourceRelations()
Source relations (getter).

Returns:
Source relations

setSourceRelations

void setSourceRelations(List<IRelation> relations)
Source relations (setter).

Parameters:
relations - Relations to set

getTargetRelations

List<IRelation> getTargetRelations()
Target relations (getter).

Returns:
Target relations

setTargetRelations

void setTargetRelations(List<IRelation> relations)
Target relations (setter).

Parameters:
relations - The relations to set

isConnected

boolean isConnected(IEntity entity)
Returns true if the entity is directly connected with given entity.

Parameters:
entity - The entity checked for connection.
Returns:
True if these entities are connected


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.