|
||||||||||
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 |
crossProduct
True if the matching between the models shall base on a full cross product between both models. |
private java.util.Vector<Matching> |
detailedMatchings
This vector stores all the atomic matchings between both models. |
private Model |
leftModel
The first model that the user has chosen to compare. |
private Model |
metaModel
The metaModel that describes the elements and the structure of the both models. |
private Model |
rightModel
The second model that the user has chosen to compare. |
private boolean |
useTreePosition
This 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> |
weightings
This 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: MetaClassComparator
AttributeComparator
ReferenceComparator
ContainerComparator
ContentsComparator
individually initialized GenericFeatureComparator (s)
the PositionComparator (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
Model
private Model rightModel
Model
private Model metaModel
Model
private java.util.Vector<Matching> detailedMatchings
Vector
private java.util.Hashtable<java.lang.String,java.lang.Double> weightings
private boolean crossProduct
Hashtable
private 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)
MetaClassComparator
AttributeComparator
ReferenceComparator
ContainerComparator
ContentsComparator
GenericFeatureComparator
(s)PositionComparator
(for critical matching-values only)
model1
- the left model.model2
- the right model.
leftModel
,
rightModel
,
Matching
public Model getLeftModel()
leftModel
public Model getRightModel()
rightModel
public Model getMetaModel()
metaModel
public java.util.Vector<Matching> getDetailedMatchings()
detailedMatchings
public 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 |