Class MatchResult<T>

  • Type Parameters:
    T - type of input to the algorithm
    All Implemented Interfaces:
    java.lang.Comparable<MatchResult<?>>

    public class MatchResult<T>
    extends java.lang.Object
    implements java.lang.Comparable<MatchResult<?>>
    Result of a match algorithm.
    Since:
    7.0.0
    Author:
    Clément Fournier
    • Constructor Summary

      Constructors 
      Constructor Description
      MatchResult​(int score, T data, java.lang.String suggestion, java.lang.String query, javafx.scene.text.TextFlow textFlow)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(MatchResult<?> o)  
      T getData()
      Data from which the candidate string was extracted.
      java.lang.String getQuery()
      Query that was matched against the candidate string.
      int getScore()
      Relevance score of this result.
      java.lang.String getStringMatch()
      Candidate string that was matched against the query.
      javafx.scene.text.TextFlow getTextFlow()
      Formatted TextFlow with the match regions highlighted.
      • Methods inherited from class java.lang.Object

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

      • MatchResult

        public MatchResult​(int score,
                           T data,
                           java.lang.String suggestion,
                           java.lang.String query,
                           javafx.scene.text.TextFlow textFlow)
    • Method Detail

      • getData

        public T getData()
        Data from which the candidate string was extracted.
      • getStringMatch

        public java.lang.String getStringMatch()
        Candidate string that was matched against the query.
      • getQuery

        public java.lang.String getQuery()
        Query that was matched against the candidate string. This is the user input.
      • getTextFlow

        public javafx.scene.text.TextFlow getTextFlow()
        Formatted TextFlow with the match regions highlighted.
      • getScore

        public int getScore()
        Relevance score of this result. This is largely implementation specific and has no meaning unless comparing with results selected by the same implementation that produced this match.
      • compareTo

        public int compareTo​(MatchResult<?> o)
        Specified by:
        compareTo in interface java.lang.Comparable<T>