org.apache.lucene.search

## Class WildcardTermEnum

- java.lang.Object
- - org.apache.lucene.index.TermEnum
  - - org.apache.lucene.search.FilteredTermEnum
    - - org.apache.lucene.search.WildcardTermEnum

-     public class WildcardTermEnum
      extends FilteredTermEnum

  Subclass of FilteredTermEnum for enumerating all terms that match the specified wildcard filter term.

  Term enumerations are always ordered by Term.compareTo(). Each term in the enumeration is greater than all that precede it.

  Version:
    $Id: WildcardTermEnum.java 988682 2010-08-24 19:30:07Z rmuir $

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static char` | `WILDCARD_CHAR`
    `static char` | `WILDCARD_STRING` String equality with support for wildcards

    - ### Fields inherited from class org.apache.lucene.search.FilteredTermEnum

      `actualEnum, currentTerm`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WildcardTermEnum(IndexReader reader, Term term)` Creates a new `WildcardTermEnum`.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `float` | `difference()` Equality measure on the term
    `boolean` | `endEnum()` Indicates the end of the enumeration has been reached
    `protected boolean` | `termCompare(Term term)` Equality compare on the term
    `static boolean` | `wildcardEquals(java.lang.String pattern, int patternIdx, java.lang.String string, int stringIdx)` Determines if a word matches a wildcard pattern.

    - ### Methods inherited from class org.apache.lucene.search.FilteredTermEnum

      `close, docFreq, next, setEnum, term`

    - ### Methods inherited from class org.apache.lucene.index.TermEnum

      `skipTo`

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

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

- - ### Field Detail

    - #### WILDCARD_STRING

          public static final char WILDCARD_STRING

      String equality with support for wildcards
      See Also:
        Constant Field Values

    - #### WILDCARD_CHAR

          public static final char WILDCARD_CHAR

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### WildcardTermEnum

          public WildcardTermEnum(IndexReader reader,
                                  Term term)
                           throws java.io.IOException

      Creates a new `WildcardTermEnum`.

      After calling the constructor the enumeration is already pointing to the first valid term if such a term exists.

      Throws:
        `java.io.IOException`

  - ### Method Detail

    - #### termCompare

          protected final boolean termCompare(Term term)

      Description copied from class: `FilteredTermEnum`
      Equality compare on the term
      Specified by:
        `termCompare` in class `FilteredTermEnum`

    - #### difference

          public float difference()

      Description copied from class: `FilteredTermEnum`
      Equality measure on the term
      Specified by:
        `difference` in class `FilteredTermEnum`

    - #### endEnum

          public final boolean endEnum()

      Description copied from class: `FilteredTermEnum`
      Indicates the end of the enumeration has been reached
      Specified by:
        `endEnum` in class `FilteredTermEnum`

    - #### wildcardEquals

          public static final boolean wildcardEquals(java.lang.String pattern,
                                                     int patternIdx,
                                                     java.lang.String string,
                                                     int stringIdx)

      Determines if a word matches a wildcard pattern. Work released by Granta Design Ltd after originally being done on company time.

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