| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.infai.emo.matcher.action.ModelComparator
public class ModelComparator
Class used for comparing the two given models.
 The sequence of the comparators is defined in this class.
 This class offers methods for initializing models and comparing them.
| Field Summary | |
|---|---|
| private  boolean | crossProductTrue if the matching between the models shall base on a full cross product between both models. | 
| private  java.util.Vector<Matching> | detailedMatchingsThis vector stores all the atomic matchings between both models. | 
| private  Model | leftModelThe first model that the user has chosen to compare. | 
| private  Model | metaModelThe metaModel that describes the elements and the structure of the both models. | 
| private  Model | rightModelThe second model that the user has chosen to compare. | 
| private  boolean | useTreePositionThis flag indicates whether to use the elements positions in the model-trees for the comparison or not. | 
| private  java.util.Hashtable<java.lang.String,java.lang.Double> | weightingsThis HashTable contains the weightings for the individual comparators. | 
| Constructor Summary | |
|---|---|
| ModelComparator(java.util.Hashtable<java.lang.String,java.lang.Double> weightings,
                boolean crossProduct,
                boolean useTreePosition)Produces a new ModelComparator with the given weightings for the atomic comparators. | |
| Method Summary | |
|---|---|
|  Matching | compareTo(Model model1,
          Model model2)This method compares the two given models using the following comparators: MetaClassComparatorAttributeComparatorReferenceComparatorContainerComparatorContentsComparatorindividually initializedGenericFeatureComparator(s)
 thePositionComparator(for critical matching-values only) | 
|  java.util.Vector<Matching> | getDetailedMatchings() | 
|  Model | getLeftModel() | 
|  Model | getMetaModel() | 
|  Model | getRightModel() | 
|  java.util.Hashtable<java.lang.String,java.lang.Double> | getWeightings() | 
| private  Model | initModel(org.eclipse.emf.ecore.EObject o)Create a model out of the given EObject. | 
| private  Model | initModel(java.lang.String path)Create a model out of the given path. | 
|  void | initModels(org.eclipse.emf.ecore.EObject leftEObject,
           org.eclipse.emf.ecore.EObject rightEObject)Initializes the models from their parent EObjects. | 
|  void | initModels(java.lang.String leftModelPath,
           java.lang.String rightModelPath,
           java.lang.String metaModelPath)Initializes the models from their paths. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
private Model leftModel
Modelprivate Model rightModel
Modelprivate Model metaModel
Modelprivate java.util.Vector<Matching> detailedMatchings
Vectorprivate java.util.Hashtable<java.lang.String,java.lang.Double> weightings
private boolean crossProduct
Hashtableprivate boolean useTreePosition
| Constructor Detail | 
|---|
public ModelComparator(java.util.Hashtable<java.lang.String,java.lang.Double> weightings,
                       boolean crossProduct,
                       boolean useTreePosition)
weightings to null.
weightings - a Hashtable with the weightings for each comparator.crossProduct - whether to make a full comparison between both models or not.useTreePosition - whether to take the positions of the elements into account or not.weightings, 
crossProduct, 
useTreePosition| Method Detail | 
|---|
public void initModels(java.lang.String leftModelPath,
                       java.lang.String rightModelPath,
                       java.lang.String metaModelPath)
leftModelPath - path to the first model.rightModelPath - path to the second model.metaModelPath - path to the meta model, that can also be null or an empty String.
public void initModels(org.eclipse.emf.ecore.EObject leftEObject,
                       org.eclipse.emf.ecore.EObject rightEObject)
leftEObject - left element.rightEObject - right element.private Model initModel(java.lang.String path)
path - the path that resolves the model file.
private Model initModel(org.eclipse.emf.ecore.EObject o)
EObject.
o - the parent object.
public Matching compareTo(Model model1,
                          Model model2)
MetaClassComparatorAttributeComparatorReferenceComparatorContainerComparatorContentsComparatorGenericFeatureComparator(s)PositionComparator (for critical matching-values only)
model1 - the left model.model2 - the right model.
leftModel, 
rightModel, 
Matchingpublic Model getLeftModel()
leftModelpublic Model getRightModel()
rightModelpublic Model getMetaModel()
metaModelpublic java.util.Vector<Matching> getDetailedMatchings()
detailedMatchingspublic java.util.Hashtable<java.lang.String,java.lang.Double> getWeightings()
weightings| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||