|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.unitils.reflectionassert.util.MatchingScoreCalculator
public class MatchingScoreCalculator
A utility class to be able to calculate a score of how well 2 elements match. This enables us to find the best matching differences out of all element differences in an unordered collection difference.
Nested Class Summary | |
---|---|
protected class |
MatchingScoreCalculator.MatchingScoreVisitor
The visitor for visiting the difference tree. |
Field Summary | |
---|---|
protected Map<Difference,Integer> |
cachedMatchingScores
Cache for matching scores |
protected MatchingScoreCalculator.MatchingScoreVisitor |
matchingScoreVisitor
The visitor for visiting the difference tree |
Constructor Summary | |
---|---|
MatchingScoreCalculator()
|
Method Summary | |
---|---|
int |
calculateMatchingScore(Difference difference)
Gets the matching score for the given difference. |
protected int |
getMatchingScore(CollectionDifference collectionDifference)
Gets the matching score for a collection difference. |
protected int |
getMatchingScore(Difference difference)
Gets the matching score for a simple difference. |
protected int |
getMatchingScore(MapDifference mapDifference)
Gets the matching score for a map difference. |
protected int |
getMatchingScore(ObjectDifference objectDifference)
Gets the matching score for an object difference. |
protected int |
getMatchingScore(UnorderedCollectionDifference unorderedCollectionDifference)
Gets the matching score for an unordered collection difference. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected MatchingScoreCalculator.MatchingScoreVisitor matchingScoreVisitor
protected Map<Difference,Integer> cachedMatchingScores
Constructor Detail |
---|
public MatchingScoreCalculator()
Method Detail |
---|
public int calculateMatchingScore(Difference difference)
difference
- The difference
protected int getMatchingScore(Difference difference)
difference
- The difference, not null
protected int getMatchingScore(ObjectDifference objectDifference)
objectDifference
- The difference, not null
protected int getMatchingScore(MapDifference mapDifference)
mapDifference
- The difference, not null
protected int getMatchingScore(CollectionDifference collectionDifference)
collectionDifference
- The difference, not null
protected int getMatchingScore(UnorderedCollectionDifference unorderedCollectionDifference)
unorderedCollectionDifference
- The difference, not null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |