org.apache.lucene.search.regex

## Class JakartaRegexpCapabilities

- java.lang.Object
- - org.apache.lucene.search.regex.JakartaRegexpCapabilities

- All Implemented Interfaces:
    RegexCapabilities

      public class JakartaRegexpCapabilities
      extends java.lang.Object
      implements RegexCapabilities

  Implementation tying Jakarta Regexp to RegexQuery. Thanks to some internals of Jakarta Regexp, this has a solid `prefix()` implementation.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `FLAG_MATCH_CASEINDEPENDENT` Flag to specify that matching should be case-independent (folded)
    `static int` | `FLAG_MATCH_NORMAL` Flag to specify normal, case-sensitive matching behaviour.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JakartaRegexpCapabilities()` Constructs a RegexCapabilities with the default MATCH_NORMAL match style.
    `JakartaRegexpCapabilities(int flags)` Constructs a RegexCapabilities with the provided match flags.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `compile(java.lang.String pattern)` Called by the constructor of `RegexTermEnum` allowing implementations to cache a compiled version of the regular expression pattern.
    `boolean` | `equals(java.lang.Object o)`
    `int` | `hashCode()`
    `boolean` | `match(java.lang.String string)`
    `java.lang.String` | `prefix()` A wise prefix implementation can reduce the term enumeration (and thus increase performance) of RegexQuery dramatically!

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

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

- - ### Field Detail

    - #### FLAG_MATCH_NORMAL

          public static final int FLAG_MATCH_NORMAL

      Flag to specify normal, case-sensitive matching behaviour. This is the default.
      See Also:
        Constant Field Values

    - #### FLAG_MATCH_CASEINDEPENDENT

          public static final int FLAG_MATCH_CASEINDEPENDENT

      Flag to specify that matching should be case-independent (folded)
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### JakartaRegexpCapabilities

          public JakartaRegexpCapabilities()

      Constructs a RegexCapabilities with the default MATCH_NORMAL match style.

    - #### JakartaRegexpCapabilities

          public JakartaRegexpCapabilities(int flags)

      Constructs a RegexCapabilities with the provided match flags. Multiple flags should be ORed together.
      Parameters:
        `flags` - The matching style

  - ### Method Detail

    - #### compile

          public void compile(java.lang.String pattern)

      Description copied from interface: `RegexCapabilities`
      Called by the constructor of `RegexTermEnum` allowing implementations to cache a compiled version of the regular expression pattern.
      Specified by:
        `compile` in interface `RegexCapabilities`
      Parameters:
        `pattern` - regular expression pattern

    - #### match

          public boolean match(java.lang.String string)

      Specified by:
        `match` in interface `RegexCapabilities`
      Returns:
        true if string matches the pattern last passed to `RegexCapabilities.compile(java.lang.String)`.

    - #### prefix

          public java.lang.String prefix()

      Description copied from interface: `RegexCapabilities`
      A wise prefix implementation can reduce the term enumeration (and thus increase performance) of RegexQuery dramatically!
      Specified by:
        `prefix` in interface `RegexCapabilities`
      Returns:
        static non-regex prefix of the pattern last passed to `RegexCapabilities.compile(java.lang.String)`. May return null.

    - #### equals

          public boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.