Examples of MatchingScoreCalculator


Examples of org.jtester.hamcrest.matcher.property.reflection.MatchingScoreCalculator

   * @param difference
   *            The difference to which all indexes will be added, not null
   */
  protected void setBestMatchingIndexes(ArrayList<Integer> leftIndexes, ArrayList<Integer> rightIndexes,
      UnorderedCollectionDifference difference) {
    MatchingScoreCalculator matchingScoreCalculator = createMatchingScoreCalculator();
    Map<Integer, Map<Integer, Difference>> differences = difference.getElementDifferences();

    for (Integer leftIndex : leftIndexes) {
      int score = Integer.MAX_VALUE;
      for (Integer rightIndex : rightIndexes) {
        Difference elementDifference = differences.get(leftIndex).get(rightIndex);

        int matchingScore = matchingScoreCalculator.calculateMatchingScore(elementDifference);
        if (matchingScore < score) {
          score = matchingScore;
          difference.setBestMatchingIndexes(leftIndex, rightIndex);
        }
      }
View Full Code Here

Examples of org.jtester.hamcrest.matcher.property.reflection.MatchingScoreCalculator

   * elements.
   *
   * @return The instance, not null
   */
  protected MatchingScoreCalculator createMatchingScoreCalculator() {
    return new MatchingScoreCalculator();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.