org.eclipse.handly.ui.quickoutline

## Class FilteringOutlinePopup.StringMatcher

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

- All Implemented Interfaces:
    java.util.function.Predicate<java.lang.String>
  Enclosing class:
    FilteringOutlinePopup

      protected static class FilteringOutlinePopup.StringMatcher
      extends java.lang.Object
      implements java.util.function.Predicate<java.lang.String>

  A string pattern matcher that supports '*' and '?' wildcards.

- - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `test(java.lang.String text)`
    `protected java.lang.String` | `translatePattern(java.lang.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, isEqual, negate, or`

- - ### Constructor Detail

    - #### StringMatcher

          public StringMatcher(java.lang.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 Detail

    - #### test

          public final boolean test(java.lang.String text)

      Specified by:
        `test` in interface `java.util.function.Predicate<java.lang.String>`

    - #### translatePattern

          protected java.lang.String translatePattern(java.lang.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`)

Copyright (c) 2014, 2020 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0