/src/LinFu.Finders/Interfaces/IFuzzyItem.cs

http://github.com/philiplaureano/LinFu · C# · 38 lines · 10 code · 3 blank · 25 comment · 0 complexity · e7710581535080bd7d4c6bf5956c071d MD5 · raw file

  1. namespace LinFu.Finders.Interfaces
  2. {
  3. /// <summary>
  4. /// Represents a search item in a fuzzy search list.
  5. /// </summary>
  6. /// <typeparam name="T"></typeparam>
  7. public interface IFuzzyItem<T>
  8. {
  9. /// <summary>
  10. /// Reports the probability of a match
  11. /// based on the <see cref="ICriteria{T}" />
  12. /// that has been tested so far.
  13. /// A value of 1.0 indicates a 100% match;
  14. /// A value of 0.0 equals a zero percent match.
  15. /// </summary>
  16. double Confidence { get; }
  17. /// <summary>
  18. /// Gets the target item.
  19. /// </summary>
  20. T Item { get; }
  21. /// <summary>
  22. /// Tests if the current item matches the given
  23. /// <paramref name="criteria" />.
  24. /// </summary>
  25. /// <param name="criteria">
  26. /// The <see cref="ICriteria{T}" /> that determines whether or not the <see cref="Item" /> meets a
  27. /// particular description.
  28. /// </param>
  29. void Test(ICriteria<T> criteria);
  30. /// <summary>
  31. /// Resets the item back to its initial state.
  32. /// </summary>
  33. void Reset();
  34. }
  35. }