ucot.model.relation
Class RelationalAnalyzeModelEditor

java.lang.Object
  extended by ucot.model.relation.RelationalAnalyzeModelEditor
All Implemented Interfaces:
ModelEditor

public class RelationalAnalyzeModelEditor
extends java.lang.Object
implements ModelEditor


Field Summary
(package private)  java.util.logging.Logger logger
           
private  RelationalAnalyzeModel model
           
 
Constructor Summary
RelationalAnalyzeModelEditor(RelationalAnalyzeModel model)
           
 
Method Summary
 void addAttribute(Entity entity, java.lang.String attributeName)
           
 void addAttribute(java.lang.String entityName, java.lang.String attributeName)
          Adds attribute to the entity.
 void addChild(java.lang.String entityName, java.lang.String childName)
          Adds child to the entity.
 void addEntity(java.lang.String name)
          Adds an entity to the model.
 void addEntityInfluenceByMethod(Entity fromEntity, java.lang.String methodName, java.lang.String influencedEntity)
           
 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.
private  void addMethod(Entity entity, java.lang.String methodName)
           
 void addMethod(java.lang.String entityName, java.lang.String methodName)
          Add method to the entity.
 void addParent(java.lang.String entityName, java.lang.String parentName)
          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 objectName, java.lang.String methodOldName, java.lang.String methodNewName)
          Changes method name.
 void clearModel()
          Clears model and makes it empty.
 boolean containsAttribute(Entity entity, java.lang.String attributeName)
           
 boolean containsAttribute(java.lang.String entityName, java.lang.String attributeName)
          Checks wheter the entity contains the attribute or not.
 boolean containsEntity(java.lang.String objectName)
          Does the model contain the entity?
private  boolean containsMethod(Entity entity, java.lang.String methodName)
           
 boolean containsMethod(java.lang.String objectName, java.lang.String methodName)
          Checks if the given method exists in the entity
 boolean containsRelation(java.lang.String fromEntity, java.lang.String toEntity)
           
 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(Entity entity)
           
 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.
private  java.util.Set<java.lang.String> getEntitiesInfluencedByMethod(Entity entity, java.lang.String methodName)
           
 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.util.Set<java.lang.String> getMethodNames(java.lang.String objectName)
          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.
 void merge(AnalyzeModel fromModel)
          Merges given AnalyzeModel to the model that this editor modifies.
 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 objectName, java.lang.String methodName)
          Removes method from the entity.
 void removeParent(java.lang.String entityName, java.lang.String parentName)
          Removes given parent from the entity.
 void setAttributeFromCardinal(Entity entity, java.lang.String attributeName, java.lang.String cardinal)
           
 void setAttributeFromCardinal(java.lang.String entityName, java.lang.String attributeName, java.lang.String cardinal)
          Sets the cardinality on the entitys side.
 void setAttributeToCardinal(Entity entity, java.lang.String attributeName, java.lang.String cardinal)
           
 void setAttributeToCardinal(java.lang.String entityName, java.lang.String attributeName, java.lang.String cardinal)
          Sets the cardinality on attributes side.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

java.util.logging.Logger logger

model

private RelationalAnalyzeModel model
Constructor Detail

RelationalAnalyzeModelEditor

public RelationalAnalyzeModelEditor(RelationalAnalyzeModel model)
Method Detail

addMethod

public void addMethod(java.lang.String entityName,
                      java.lang.String methodName)
Description copied from interface: ModelEditor
Add method to the entity.

Specified by:
addMethod in interface ModelEditor
Parameters:
entityName - The name of the entity.
methodName - The name of the method.

addMethod

private void addMethod(Entity entity,
                       java.lang.String methodName)

addEntity

public void addEntity(java.lang.String name)
Description copied from interface: ModelEditor
Adds an entity to the model.

Specified by:
addEntity in interface ModelEditor
Parameters:
name - The name of the entity.

containsMethod

public boolean containsMethod(java.lang.String objectName,
                              java.lang.String methodName)
Description copied from interface: ModelEditor
Checks if the given method exists in the entity

Specified by:
containsMethod in interface ModelEditor
Parameters:
objectName - The name of the entity
methodName - The name of the method.
Returns:
True if the entity has given method.

containsMethod

private boolean containsMethod(Entity entity,
                               java.lang.String methodName)

containsEntity

public boolean containsEntity(java.lang.String objectName)
Description copied from interface: ModelEditor
Does the model contain the entity?

Specified by:
containsEntity in interface ModelEditor
Parameters:
objectName - The name of the entity which existence is checked.
Returns:
true if exists false if does not.

changeMethodName

public void changeMethodName(java.lang.String objectName,
                             java.lang.String methodOldName,
                             java.lang.String methodNewName)
Description copied from interface: ModelEditor
Changes method name.

Specified by:
changeMethodName in interface ModelEditor
Parameters:
objectName - The name of the entity.

changeEntityName

public void changeEntityName(java.lang.String oldName,
                             java.lang.String newName)
Description copied from interface: ModelEditor
Changes the name of the entity.

Specified by:
changeEntityName in interface ModelEditor
Parameters:
oldName - The entity name that is going to be changed.
newName - The new name for that entity.

removeMethod

public void removeMethod(java.lang.String objectName,
                         java.lang.String methodName)
Description copied from interface: ModelEditor
Removes method from the entity.

Specified by:
removeMethod in interface ModelEditor
Parameters:
objectName - The entity which owns the method.
methodName - The name of the method.

removeEntity

public void removeEntity(java.lang.String name)
Description copied from interface: ModelEditor
Removes entity from model.

Specified by:
removeEntity in interface ModelEditor
Parameters:
name - The name of the entity.

addAttribute

public void addAttribute(java.lang.String entityName,
                         java.lang.String attributeName)
Description copied from interface: ModelEditor
Adds attribute to the entity.

Specified by:
addAttribute in interface ModelEditor
Parameters:
entityName - The name of the entity.
attributeName - The name of the attribute.

addAttribute

public void addAttribute(Entity entity,
                         java.lang.String attributeName)

removeAttribute

public void removeAttribute(java.lang.String entityName,
                            java.lang.String attributeName)
Description copied from interface: ModelEditor
Removes attribute from the entity.

Specified by:
removeAttribute in interface ModelEditor
Parameters:
entityName - The name of the entity.
attributeName - The name of the attribute.

containsAttribute

public boolean containsAttribute(java.lang.String entityName,
                                 java.lang.String attributeName)
Description copied from interface: ModelEditor
Checks wheter the entity contains the attribute or not.

Specified by:
containsAttribute in interface ModelEditor
Parameters:
entityName - The name of the entity.
attributeName - The name of the attribute.
Returns:
True if contains.

containsAttribute

public boolean containsAttribute(Entity entity,
                                 java.lang.String attributeName)

getAttributeNames

public java.util.Set<java.lang.String> getAttributeNames(java.lang.String entityName)
Description copied from interface: ModelEditor
Returns the attributes of the entity.

Specified by:
getAttributeNames in interface ModelEditor
Parameters:
entityName - The name of the entity.
Returns:
The attributes.

getAttributeNames

public java.util.Set<java.lang.String> getAttributeNames(Entity entity)

clearModel

public void clearModel()
Description copied from interface: ModelEditor
Clears model and makes it empty.

Specified by:
clearModel in interface ModelEditor

getMethodNames

public java.util.Set<java.lang.String> getMethodNames(java.lang.String objectName)
Description copied from interface: ModelEditor
Returns the names of the entity's methods.

Specified by:
getMethodNames in interface ModelEditor
Parameters:
objectName - The name of the entity
Returns:
The entity's methods' names.

getEntityNames

public java.util.Set<java.lang.String> getEntityNames()
Specified by:
getEntityNames in interface ModelEditor
Returns:
the names of the entities that the model contains.

containsRelation

public boolean containsRelation(java.lang.String fromEntity,
                                java.lang.String toEntity)

getEntitiesInfluencedByMethod

public java.util.Set<java.lang.String> getEntitiesInfluencedByMethod(java.lang.String entityName,
                                                                     java.lang.String methodName)
Description copied from interface: ModelEditor
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.

Specified by:
getEntitiesInfluencedByMethod in interface ModelEditor
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.

getEntitiesInfluencedByMethod

private java.util.Set<java.lang.String> getEntitiesInfluencedByMethod(Entity entity,
                                                                      java.lang.String methodName)

addEntityInfluenceByMethod

public void addEntityInfluenceByMethod(java.lang.String entityName,
                                       java.lang.String methodName,
                                       java.lang.String influencedEntity)
Description copied from interface: ModelEditor
Adds an influence between entity's method and the given entity.

Specified by:
addEntityInfluenceByMethod in interface ModelEditor
Parameters:
entityName - The name of the entity that owns the method.
methodName - The methods name.
See Also:
ModelEditor.getEntitiesInfluencedByMethod(String, String)

addEntityInfluenceByMethod

public void addEntityInfluenceByMethod(Entity fromEntity,
                                       java.lang.String methodName,
                                       java.lang.String influencedEntity)

removeEntityInfluenceByMethod

public void removeEntityInfluenceByMethod(java.lang.String entityName,
                                          java.lang.String methodName,
                                          java.lang.String influencedEntity)
Description copied from interface: ModelEditor
Removes influnce between entity's method and the given entity.

Specified by:
removeEntityInfluenceByMethod in interface ModelEditor
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:
ModelEditor.getEntitiesInfluencedByMethod(String, String)

getAttributeFromCardinal

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

Specified by:
getAttributeFromCardinal in interface ModelEditor
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

public java.lang.String getAttributeToCardinal(java.lang.String entityName,
                                               java.lang.String attributeName)
Description copied from interface: ModelEditor
Gets to part of the cardinality of the attribute relation. To part means the cardinality on the attributes side.

Specified by:
getAttributeToCardinal in interface ModelEditor
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

public void setAttributeFromCardinal(java.lang.String entityName,
                                     java.lang.String attributeName,
                                     java.lang.String cardinal)
Description copied from interface: ModelEditor
Sets the cardinality on the entitys side.

Specified by:
setAttributeFromCardinal in interface ModelEditor
Parameters:
entityName - The name of the entity.
attributeName - The name of the attibute.
cardinal - The cardinality value.

setAttributeFromCardinal

public void setAttributeFromCardinal(Entity entity,
                                     java.lang.String attributeName,
                                     java.lang.String cardinal)

setAttributeToCardinal

public void setAttributeToCardinal(java.lang.String entityName,
                                   java.lang.String attributeName,
                                   java.lang.String cardinal)
Description copied from interface: ModelEditor
Sets the cardinality on attributes side.

Specified by:
setAttributeToCardinal in interface ModelEditor
Parameters:
entityName - The name of the entity.
attributeName - The name of the attibute.
cardinal - The cardinality value.

setAttributeToCardinal

public void setAttributeToCardinal(Entity entity,
                                   java.lang.String attributeName,
                                   java.lang.String cardinal)

merge

public void merge(AnalyzeModel fromModel)
Description copied from interface: ModelEditor
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.

Specified by:
merge in interface ModelEditor
Parameters:
fromModel - The analyze model beign merged.

addChild

public void addChild(java.lang.String entityName,
                     java.lang.String childName)
Description copied from interface: ModelEditor
Adds child to the entity.

Specified by:
addChild in interface ModelEditor
Parameters:
entityName - The name of parent entity.
childName - The name of the child.

addParent

public void addParent(java.lang.String entityName,
                      java.lang.String parentName)
Description copied from interface: ModelEditor
Adds parent to the entity.

Specified by:
addParent in interface ModelEditor
Parameters:
entityName - The name of the child entity.
parentName - The name of the parent entity.

getChildren

public java.util.Set<java.lang.String> getChildren(java.lang.String entityName)
Description copied from interface: ModelEditor
Returns the names of the entity's children.

Specified by:
getChildren in interface ModelEditor
Parameters:
entityName - The name of the entity.
Returns:
The child of the given entity.

getParents

public java.util.Set<java.lang.String> getParents(java.lang.String entityName)
Description copied from interface: ModelEditor
Returns the parents of the entity.

Specified by:
getParents in interface ModelEditor
Parameters:
entityName - The name of the entity.
Returns:
The parents of the given entity.

removeChild

public void removeChild(java.lang.String entityName,
                        java.lang.String childEntity)
Description copied from interface: ModelEditor
Removes given child from the entity.

Specified by:
removeChild in interface ModelEditor
Parameters:
entityName - The entity.
childEntity - The child to be removed.

removeAllChildren

public void removeAllChildren(java.lang.String entityName)
Description copied from interface: ModelEditor
Removes all the children from the entity.

Specified by:
removeAllChildren in interface ModelEditor

removeAllParents

public void removeAllParents(java.lang.String entityName)
Description copied from interface: ModelEditor
Removes all the parents of the entity.

Specified by:
removeAllParents in interface ModelEditor
Parameters:
entityName - the name of the entity.

removeParent

public void removeParent(java.lang.String entityName,
                         java.lang.String parentName)
Description copied from interface: ModelEditor
Removes given parent from the entity.

Specified by:
removeParent in interface ModelEditor
Parameters:
entityName - The name of the child entity.
parentName - The name of the parent entity.