org.infai.emo.matcher.impl
Class PositionComparator

java.lang.Object
  extended by org.infai.emo.matcher.impl.PositionComparator

public class PositionComparator
extends java.lang.Object

Class for comparing the positions of the model-elements in the tree-notation of the model.
Class should only be used for critical decisions to determine which alternative is the best one.

Version:
1.0.0
Author:
Stanley Hillner

Field Summary
private  Model leftModel
          The left model for the comparison.
private  Matching matching
          The matching that contains the results of the comparison of both models.
private  Model rightModel
          The right model for the comparison.
 
Constructor Summary
PositionComparator(Matching previousMatching, Model leftModel, Model rightModel)
          Initialize the comparator with the matching and the models.
 
Method Summary
 Matching compare()
          This method compares the maximum matching-entries for each element of the models by analyzing the matching.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

leftModel

private Model leftModel
The left model for the comparison.

See Also:
Mapping

rightModel

private Model rightModel
The right model for the comparison.

See Also:
Mapping

matching

private Matching matching
The matching that contains the results of the comparison of both models.
This matching will be analyzed in order to determine where possible conflicts are.

See Also:
Matching
Constructor Detail

PositionComparator

public PositionComparator(Matching previousMatching,
                          Model leftModel,
                          Model rightModel)
Initialize the comparator with the matching and the models.

Parameters:
previousMatching - the matching for analysis and modification.
leftModel - the left model of the comparison.
rightModel - the right model of the comparison.
Method Detail

compare

public Matching compare()
This method compares the maximum matching-entries for each element of the models by analyzing the matching.
A conflict for an element is given, if there are more than one element that have the same maximum matching-value for this element.
In this case the positions of all involved elements will be taken into account and the matching will be modified.

Returns:
the modified matching in which each element doesn't have more than one maximum matching-value.