oracle.javatools.ui.search
Class SearchMatcher

This class is abstract. You can obtain an instance of a specific matching algorithm by calling one of the static factory methods.

Two standard implementations are provided.

substring matcher will return true if the text to search contains the search string as a substring.

prefix matcher will return true if any of the words in the text to search are prefixed by any of the words in the search string. A word is any sequence of letters or digits surrounded by non digits or letters (e.g. whitespace, symbols)

The recommended default for general text search is the prefix matcher configured to be case insensitive and exclusive, i.e.:

getPrefixMatcher(java.lang.CharSequence searchString, boolean ignoreCase, boolean exclusive)
Returns a matcher which will match if any of the words in the search string can be found as prefixes of words in the text to search.

getPrefixMatcher

Returns a matcher which will match if any of the words in the search string can be found as prefixes of words in the text to search.

The exclusive parameter can be used to control whether this is a mutually exclusive (OR) search (the match will be successful if any of the words in the search string are prefixes of words in the text to search), or an AND search (the match will be successful if all of the words in the search string are prefixes of words in the text to search).

Parameters:

searchString - the search string.

ignoreCase - if true, case will be considered insignificant while matching.

exclusive - if true, the match will be successful if any of the words in the search string are prefixes of words in the text to search. If false, the match will be successful if all of the words in the search string are prefixes of words in the text to search.