Class StringMatchUtil
- java.lang.Object
-
- net.sourceforge.pmd.util.fxdesigner.util.autocomplete.matchers.StringMatchUtil
-
public final class StringMatchUtil extends java.lang.ObjectUtility class.
-
-
Field Summary
Fields Modifier and Type Field Description static intMIN_QUERY_LENGTHstatic intPERFECT_SCOREstatic intWORST_SCORE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> java.util.stream.Stream<MatchResult<T>>filterResults(java.util.List<? extends T> candidates, java.util.function.Function<? super T,java.lang.String> matchExtractor, java.lang.String query, MatchSelector<T> limiter)Selects the bestMatchResultgiven a list of candidates and a query.
-
-
-
Field Detail
-
MIN_QUERY_LENGTH
public static final int MIN_QUERY_LENGTH
- See Also:
- Constant Field Values
-
WORST_SCORE
public static final int WORST_SCORE
- See Also:
- Constant Field Values
-
PERFECT_SCORE
public static final int PERFECT_SCORE
- See Also:
- Constant Field Values
-
-
Method Detail
-
filterResults
public static <T> java.util.stream.Stream<MatchResult<T>> filterResults(java.util.List<? extends T> candidates, java.util.function.Function<? super T,java.lang.String> matchExtractor, java.lang.String query, MatchSelector<T> limiter)
Selects the bestMatchResultgiven a list of candidates and a query.The results are useless unless you provide the
MatchSelectorthat suits your use case (limiter).- Parameters:
candidates- List of stuff to sortmatchExtractor- Extracts the searchable text from an itemlimiter- Selects the best candidates, may process them further to break tiesquery- Text to search for
-
-