ucot.model
Interface ModelEditor

All Known Implementing Classes:
ObjectAnalyzeModelEditor

public interface ModelEditor

ModelEditor is a interface to edit AnalyzeModel. Edition is made trough it to make it possible to implement undo/redo in the future.


Method Summary
 void addAttribute(java.lang.String entityName, java.lang.String attributeName)
          Adds attribute to the entity.
 void addChild(java.lang.String entityName, java.lang.String childEntity)
          Adds child to the entity.
 void addEntity(java.lang.String name)
          Adds an entity to the model.
 void addEntityInfluenceByMethod(java.lang.String entityName, java.lang.String methodName, java.lang.String influencedEntity)
          Adds an influence between entity's method and the given entity.
 void addMethod(java.lang.String entityName, java.lang.String methodName)
          Add method to the entity.
 void addParent(java.lang.String entityName, java.lang.String parentEntity)
          Adds parent to the entity.
 void changeEntityName(java.lang.String oldName, java.lang.String newName)
          Changes the name of the entity.
 void changeMethodName(java.lang.String entityName, java.lang.String methodOldName, java.lang.String methodNewName)
          Changes method name.
 void clearModel()
          Clears model and makes it empty.
 boolean containsAttribute(java.lang.String entityName, java.lang.String attributeName)
          Checks wheter the entity contains the attribute or not.
 boolean containsEntity(java.lang.String entityName)
          Does the model contain the entity?
 boolean containsMethod(java.lang.String entityName, java.lang.String methodName)
          Checks if the given method exists in the entity
 boolean execute(Updation updation)
          Executes action defined by updaton object.
 java.lang.String getAttributeFromCardinal(java.lang.String entityName, java.lang.String attributeName)
          Gets from part of the cardinality of the attribute relation.
 java.util.Set<java.lang.String> getAttributeNames(java.lang.String entityName)
          Returns the attributes of the entity.
 java.lang.String getAttributeToCardinal(java.lang.String entityName, java.lang.String attributeName)
          Gets to part of the cardinality of the attribute relation.
 java.util.Set<java.lang.String> getChildren(java.lang.String entityName)
          Returns the names of the entity's children.
 java.util.Set<java.lang.String> getEntitiesInfluencedByMethod(java.lang.String entityName, java.lang.String methodName)
          Returns set of entities that are refered by methods in the model.
 java.util.Set<java.lang.String> getEntityNames()
           
 java.lang.String getEntityType(java.lang.String entity)
          Returns the type of the entity.
 java.util.Set<java.lang.String> getMethodNames(java.lang.String entityName)
          Returns the names of the entity's methods.
 java.util.Set<java.lang.String> getParents(java.lang.String entityName)
          Returns the parents of the entity.
 java.util.List<Updation> getUpdations()
          Get updations done to this analyzemodel.
 void merge(AnalyzeModel model)
          Merges given AnalyzeModel to the model that this editor modifies.
 void mergeEntity(java.lang.String targetEntityName, java.util.Set<java.lang.String> mergeSet)
          Merges entities to one entity.
 void removeAllChildren(java.lang.String entityName)
          Removes all the children from the entity.
 void removeAllParents(java.lang.String entityName)
          Removes all the parents of the entity.
 void removeAttribute(java.lang.String entityName, java.lang.String attributeName)
          Removes attribute from the entity.
 void removeChild(java.lang.String entityName, java.lang.String childEntity)
          Removes given child from the entity.
 void removeEntity(java.lang.String name)
          Removes entity from model.
 void removeEntityInfluenceByMethod(java.lang.String entityName, java.lang.String methodName, java.lang.String influencedEntity)
          Removes influnce between entity's method and the given entity.
 void removeMethod(java.lang.String entityName, java.lang.String methodName)
          Removes method from the entity.
 void removeParent(java.lang.String entityName, java.lang.String parentEntity)
          Removes given parent from the entity.
 void setAttributeFromCardinal(java.lang.String entityName, java.lang.String attributeName, java.lang.String cardinal)
          Sets the cardinality on the entitys side.
 void setAttributeToCardinal(java.lang.String entityName, java.lang.String attributeName, java.lang.String cardinal)
          Sets the cardinality on attributes side.
 void setEntityType(java.lang.String entity, java.lang.String entityType)
          Sets the type of the entity.
 void stepBack(int steps)
          Undoes some edition steps.
 

Method Detail

clearModel

void clearModel()
Clears model and makes it empty.


getEntityNames

java.util.Set<java.lang.String> getEntityNames()
Returns:
the names of the entities that the model contains.

addEntity

void addEntity(java.lang.String name)
Adds an entity to the model.

Parameters:
name - The name of the entity.

removeEntity

void removeEntity(java.lang.String name)
Removes entity from model.

Parameters:
name - The name of the entity.

getEntityType

java.lang.String getEntityType(java.lang.String entity)
Returns the type of the entity.

Parameters:
entity - The name of the entity.
Returns:
The type of the entity.

setEntityType

void setEntityType(java.lang.String entity,
                   java.lang.String entityType)
Sets the type of the entity.

Parameters:
entity - The name of the entity.
entityType - The type

changeEntityName

void changeEntityName(java.lang.String oldName,
                      java.lang.String newName)
Changes the name of the entity.

Parameters:
oldName - The entity name that is going to be changed.
newName - The new name for that entity.

containsEntity

boolean containsEntity(java.lang.String entityName)
Does the model contain the entity?

Parameters:
entityName - The name of the entity which existence is checked.
Returns:
true if exists false if does not.

addParent

void addParent(java.lang.String entityName,
               java.lang.String parentEntity)
Adds parent to the entity.

Parameters:
entityName - The name of the child entity.
parentEntity - The name of the parent entity.

removeParent

void removeParent(java.lang.String entityName,
                  java.lang.String parentEntity)
Removes given parent from the entity.

Parameters:
entityName - The name of the child entity.
parentEntity - The name of the parent entity.

removeAllParents

void removeAllParents(java.lang.String entityName)
Removes all the parents of the entity.

Parameters:
entityName - the name of the entity.

getParents

java.util.Set<java.lang.String> getParents(java.lang.String entityName)
Returns the parents of the entity.

Parameters:
entityName - The name of the entity.
Returns:
The parents of the given entity.

addChild

void addChild(java.lang.String entityName,
              java.lang.String childEntity)
Adds child to the entity.

Parameters:
entityName - The name of parent entity.
childEntity - The name of the child.

removeChild

void removeChild(java.lang.String entityName,
                 java.lang.String childEntity)
Removes given child from the entity.

Parameters:
entityName - The entity.
childEntity - The child to be removed.

removeAllChildren

void removeAllChildren(java.lang.String entityName)
Removes all the children from the entity.

Parameters:
entityName -

getChildren

java.util.Set<java.lang.String> getChildren(java.lang.String entityName)
Returns the names of the entity's children.

Parameters:
entityName - The name of the entity.
Returns:
The child of the given entity.

addMethod

void addMethod(java.lang.String entityName,
               java.lang.String methodName)
Add method to the entity.

Parameters:
entityName - The name of the entity.
methodName - The name of the method.

removeMethod

void removeMethod(java.lang.String entityName,
                  java.lang.String methodName)
Removes method from the entity.

Parameters:
entityName - The entity which owns the method.
methodName - The name of the method.

changeMethodName

void changeMethodName(java.lang.String entityName,
                      java.lang.String methodOldName,
                      java.lang.String methodNewName)
Changes method name.

Parameters:
entityName - The name of the entity.
methodOldName -
methodNewName -

containsMethod

boolean containsMethod(java.lang.String entityName,
                       java.lang.String methodName)
Checks if the given method exists in the entity

Parameters:
entityName - The name of the entity
methodName - The name of the method.
Returns:
True if the entity has given method.

getMethodNames

java.util.Set<java.lang.String> getMethodNames(java.lang.String entityName)
Returns the names of the entity's methods.

Parameters:
entityName - The name of the entity
Returns:
The entity's methods' names.

getEntitiesInfluencedByMethod

java.util.Set<java.lang.String> getEntitiesInfluencedByMethod(java.lang.String entityName,
                                                              java.lang.String methodName)
Returns set of entities that are refered by methods in the model. For example sentence: A makes B can be interpereted so that make-method of entity A referes the entity B.

Parameters:
entityName - The name of the entity that owns the method.
methodName - The methods name.
Returns:
Set of entity names that are refered by the method in some way.

addEntityInfluenceByMethod

void addEntityInfluenceByMethod(java.lang.String entityName,
                                java.lang.String methodName,
                                java.lang.String influencedEntity)
Adds an influence between entity's method and the given entity.

Parameters:
entityName - The name of the entity that owns the method.
methodName - The methods name.
influencedEntity -
See Also:
getEntitiesInfluencedByMethod(String, String)

removeEntityInfluenceByMethod

void removeEntityInfluenceByMethod(java.lang.String entityName,
                                   java.lang.String methodName,
                                   java.lang.String influencedEntity)
Removes influnce between entity's method and the given entity.

Parameters:
entityName - The name of the entity that owns the method.
methodName - The methods name.
influencedEntity - The name of the method that is influenced by the given method.
See Also:
getEntitiesInfluencedByMethod(String, String)

addAttribute

void addAttribute(java.lang.String entityName,
                  java.lang.String attributeName)
Adds attribute to the entity.

Parameters:
entityName - The name of the entity.
attributeName - The name of the attribute.

removeAttribute

void removeAttribute(java.lang.String entityName,
                     java.lang.String attributeName)
Removes attribute from the entity.

Parameters:
entityName - The name of the entity.
attributeName - The name of the attribute.

containsAttribute

boolean containsAttribute(java.lang.String entityName,
                          java.lang.String attributeName)
Checks wheter the entity contains the attribute or not.

Parameters:
entityName - The name of the entity.
attributeName - The name of the attribute.
Returns:
True if contains.

getAttributeFromCardinal

java.lang.String getAttributeFromCardinal(java.lang.String entityName,
                                          java.lang.String attributeName)
Gets from part of the cardinality of the attribute relation. From part means the cardinality on the entity's side that owns the attribute.

Parameters:
entityName - The name of the entity.
attributeName - The name of the attibute.
Returns:
The cardinality value of the from part of the cardinal relation.

getAttributeToCardinal

java.lang.String getAttributeToCardinal(java.lang.String entityName,
                                        java.lang.String attributeName)
Gets to part of the cardinality of the attribute relation. To part means the cardinality on the attributes side.

Parameters:
entityName - The name of the entity.
attributeName - The name of the attibute.
Returns:
The cardinality value of the to part of the cardinal relation.

setAttributeFromCardinal

void setAttributeFromCardinal(java.lang.String entityName,
                              java.lang.String attributeName,
                              java.lang.String cardinal)
Sets the cardinality on the entitys side.

Parameters:
entityName - The name of the entity.
attributeName - The name of the attibute.
cardinal - The cardinality value.

setAttributeToCardinal

void setAttributeToCardinal(java.lang.String entityName,
                            java.lang.String attributeName,
                            java.lang.String cardinal)
Sets the cardinality on attributes side.

Parameters:
entityName - The name of the entity.
attributeName - The name of the attibute.
cardinal - The cardinality value.

getAttributeNames

java.util.Set<java.lang.String> getAttributeNames(java.lang.String entityName)
Returns the attributes of the entity.

Parameters:
entityName - The name of the entity.
Returns:
The attributes.

merge

void merge(AnalyzeModel model)
Merges given AnalyzeModel to the model that this editor modifies. This only adds things that do not yet exist in the current model. Nothing is delted or modified.

Parameters:
model - The analyze model beign merged.

getUpdations

java.util.List<Updation> getUpdations()
Get updations done to this analyzemodel.

Returns:
List of Updations or null if this feature is not supported.

mergeEntity

void mergeEntity(java.lang.String targetEntityName,
                 java.util.Set<java.lang.String> mergeSet)
Merges entities to one entity. If given entity name (targetEntityName) does not exists it is created.

Parameters:
targetEntityName - The name of the entity after merge.
mergeSet - The set of entity names that are going to be merged.

stepBack

void stepBack(int steps)
Undoes some edition steps.

Parameters:
steps - to undo

execute

boolean execute(Updation updation)
Executes action defined by updaton object.

Returns:
true if success, false if did not.