Package org.eclipse.handly.ui.quickoutline

# Class FilteringOutlinePopup.StringMatcher

java.lang.Object
org.eclipse.handly.ui.quickoutline.FilteringOutlinePopup.StringMatcher

All Implemented Interfaces:
  `Predicate<String>`

Enclosing class:
  FilteringOutlinePopup

protected static class FilteringOutlinePopup.StringMatcher extends Object implements Predicate<String>
A string pattern matcher that supports '*' and '?' wildcards.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `StringMatcher(String pattern, boolean ignoreCase)`
  Creates a new string matcher based on the given pattern.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final boolean`
  `test(String text)`
  `protected String`
  `translatePattern(String pattern)`
  Translates the given pattern into a regular expression.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface java.util.function.Predicate

  `and, negate, or`

- ## Constructor Details

  - ### StringMatcher

    public StringMatcher(String pattern, boolean ignoreCase)
    Creates a new string matcher based on the given pattern. The pattern may contain '*' for zero or more characters and '?' for exactly one character.
    Parameters:
      `pattern` - the pattern string (not `null`)
      `ignoreCase` - whether case-insensitive matching is enabled

- ## Method Details

  - ### test

    public final boolean test(String text)
    Specified by:
      `test` in interface `Predicate<String>`

  - ### translatePattern

    protected String translatePattern(String pattern)
    Translates the given pattern into a regular expression.

    This implementation always returns a regular expression that starts with '^'.

    Parameters:
      `pattern` - the pattern string (not `null`)
    Returns:
      the regular expression corresponding to the pattern (never `null`)