Class MatchResult

java.lang.Object
com.aquima.interactions.matching.result.MatchResult
All Implemented Interfaces:
IMatchResult

public class MatchResult extends Object implements IMatchResult
This class is used to return the result of match action.
Since:
6.2
Author:
O. Kerpershoek, F. van der Meer
  • Constructor Summary

    Constructors
    Constructor
    Description
    MatchResult(int maxResults, int threshold, boolean useKeyField, int maxKeyResults)
    Constructs the match result with the required arguments.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addMatchScore(String id, int percentage)
    This method will be invoked to add a single match result without a key field.
    void
    addMatchScore(String id, int percentage, ISingleValue keyField)
    This method will be invoked to add a single match result with a key field.
    This method returns all the matches from this match result.
    int
    This method returns the maximum number of results that may be present in this result class.
    int
    This method returns the number of match results.
    This method returns the matches for the specified key field value.
    int
    This method returns the minimum score a case should have in order to be included in the result.
    This method returns the key field values that are used to group the results on.
    boolean
    This method returns a boolean indicating if key-field grouping should be used.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MatchResult

      public MatchResult(int maxResults, int threshold, boolean useKeyField, int maxKeyResults)
      Constructs the match result with the required arguments.
      Parameters:
      maxResults - The maximum number of results that may be present.
      threshold - The minimum score that is required for cases in order to be allowed in the result.
      useKeyField - Boolean indicating if a key-field should be used to group results on.
      maxKeyResults - The maximum number of cases that may be grouped together under the same key.
  • Method Details

    • addMatchScore

      public void addMatchScore(String id, int percentage)
      This method will be invoked to add a single match result without a key field.
      Parameters:
      id - The id of the case for which the score is added.
      percentage - The score of the case.
    • addMatchScore

      public void addMatchScore(String id, int percentage, ISingleValue keyField)
      This method will be invoked to add a single match result with a key field.
      Parameters:
      id - The id of the case for which the score is added.
      percentage - The score of the case.
      keyField - The key field value of the case.
    • getMaxResults

      public int getMaxResults()
      This method returns the maximum number of results that may be present in this result class.
      Returns:
      the maximum number of results that may be present in this result class.
    • getThreshold

      public int getThreshold()
      This method returns the minimum score a case should have in order to be included in the result.
      Returns:
      the minimum score a case should have in order to be included in the result.
    • getUseKeyField

      public boolean getUseKeyField()
      This method returns a boolean indicating if key-field grouping should be used.
      Returns:
      a boolean indicating if key-field grouping should be used.
    • getMatches

      public IMatchScore[] getMatches()
      Description copied from interface: IMatchResult
      This method returns all the matches from this match result.
      Specified by:
      getMatches in interface IMatchResult
      Returns:
      Array containing all the matches of this match result.
    • getScoreCount

      public int getScoreCount()
      Description copied from interface: IMatchResult
      This method returns the number of match results.
      Specified by:
      getScoreCount in interface IMatchResult
      Returns:
      the number of match results.
    • getScoresForKey

      public IMatchScore[] getScoresForKey(ISingleValue key)
      Description copied from interface: IMatchResult
      This method returns the matches for the specified key field value. This method is only relevant when a key field has been used when matching.
      Specified by:
      getScoresForKey in interface IMatchResult
      Parameters:
      key - The key field value for which the match scores are requested.
      Returns:
      Array containing the matches for the specified key field value.
    • getUniqueKeys

      public ISingleValue[] getUniqueKeys()
      Description copied from interface: IMatchResult
      This method returns the key field values that are used to group the results on. This method is only relevant when a key field is used during the match.
      Specified by:
      getUniqueKeys in interface IMatchResult
      Returns:
      Array containing the key field values the results are grouped on.