org.infai.emo.matcher.action
Class DiffBuilder

java.lang.Object
  extended by org.infai.emo.matcher.action.DiffBuilder

 class DiffBuilder
extends java.lang.Object

Class for building an EMF-based difference model.

Version:
1.1.0
Author:
Stanley Hillner

Field Summary
private  DiffModel diffModel
          The EMF-Model that contains the differences between both models.
private  MapModel mapModel
          The mapping created by the MappingBuilder.
 
Constructor Summary
protected DiffBuilder(MapModel mapModel)
          Constructor for instantiating a new DiffBuilder with the mapping that is shall compute.
 
Method Summary
private  void attributeChanged(java.util.HashMap<java.lang.Integer,Group> groupObjects, MappingElement e)
          Method calculates if attributes of the elements have changed.
private  void elementMoved(java.util.HashMap<java.lang.Integer,Group> groupObjects, MappingElement e)
          Method detects changes of the element-positions.
private  void getAddRemoveElements(java.util.HashMap<java.lang.Integer,Group> groupObjects)
          Method calculates which elements were added to or removed from the original model.
private  void getChangedElements(java.util.HashMap<java.lang.Integer,Group> groupObjects)
          Method calculates which elements are contained in both models but have changed.
protected  DiffModel getDiff()
          Calculate the differences between both models.
private  void referenceChanged(java.util.HashMap<java.lang.Integer,Group> groupObjects, MappingElement e)
          Method calculates if references of the elements have changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapModel

private MapModel mapModel
The mapping created by the MappingBuilder.

See Also:
MapModel, MappingBuilder#getMapping()

diffModel

private DiffModel diffModel
The EMF-Model that contains the differences between both models.

See Also:
DiffModel
Constructor Detail

DiffBuilder

protected DiffBuilder(MapModel mapModel)
Constructor for instantiating a new DiffBuilder with the mapping that is shall compute.

Parameters:
mapModel - the mapping out of which the diff will be built.
Method Detail

getDiff

protected DiffModel getDiff()
Calculate the differences between both models.

Returns:
the model that contains the differences between both models.
See Also:
DiffModel

getAddRemoveElements

private void getAddRemoveElements(java.util.HashMap<java.lang.Integer,Group> groupObjects)
Method calculates which elements were added to or removed from the original model.

Parameters:
groupObjects - the HashMap that contains the groups for the changes.

getChangedElements

private void getChangedElements(java.util.HashMap<java.lang.Integer,Group> groupObjects)
Method calculates which elements are contained in both models but have changed.

Parameters:
groupObjects - the HashMap that contains the groups for the changes.

attributeChanged

private void attributeChanged(java.util.HashMap<java.lang.Integer,Group> groupObjects,
                              MappingElement e)
Method calculates if attributes of the elements have changed.

Parameters:
groupObjects - the HashMap that contains the groups for the changes.
e - the MappingElement that contains both model-elements

referenceChanged

private void referenceChanged(java.util.HashMap<java.lang.Integer,Group> groupObjects,
                              MappingElement e)
Method calculates if references of the elements have changed.

Parameters:
groupObjects - the HashMap that contains the groups for the changes.
e - the MappingElement that contains both model-elements

elementMoved

private void elementMoved(java.util.HashMap<java.lang.Integer,Group> groupObjects,
                          MappingElement e)
Method detects changes of the element-positions.

Parameters:
groupObjects - the HashMap that contains the groups for the changes.
e - the MappingElement that contains both model-elements