org.infai.emo.matcher.impl
Class ContentsComparator

java.lang.Object
  extended by org.infai.emo.matcher.Comparator
      extended by org.infai.emo.matcher.StructureComparator
          extended by org.infai.emo.matcher.impl.ContentsComparator

public class ContentsComparator
extends StructureComparator

Compares the contents, thus the children of the two elements if you watch the models in a tree notation.

Version:
1.1.0
Author:
Stanley Hillner
See Also:
StructureComparator

Constructor Summary
ContentsComparator(Matching matching, double comparisonCount)
          
 
Method Summary
 double compareTo(org.eclipse.emf.ecore.EObject leftElement, org.eclipse.emf.ecore.EObject rightElement)
          Compare the children of both elements.
 
Methods inherited from class org.infai.emo.matcher.StructureComparator
getComparisonCount, getMatching
 
Methods inherited from class org.infai.emo.matcher.Comparator
getName, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContentsComparator

public ContentsComparator(Matching matching,
                          double comparisonCount)

Method Detail

compareTo

public double compareTo(org.eclipse.emf.ecore.EObject leftElement,
                        org.eclipse.emf.ecore.EObject rightElement)
Compare the children of both elements.
Only direct children are considered at the comparison. Therefore the comparison determines the matching-values of previous rounds for the tuples oft the child-elements.

Specified by:
compareTo in class Comparator
Parameters:
leftElement - the left element for the comparison of the containment.
rightElement - the right element for the containment-comparison.
Returns:
This method must return a double value between 0 and 1.0
1.0 stands for a total matching without any differences and 0 means that there are no commonalities.
See Also:
EObject