org.apache.lucene.search

## Class PhraseWildcardQuery.PhraseTerm

- java.lang.Object
- - org.apache.lucene.search.PhraseWildcardQuery.PhraseTerm

Direct Known Subclasses:
  PhraseWildcardQuery.MultiTerm, PhraseWildcardQuery.SingleTerm

Enclosing class:
  PhraseWildcardQuery

    protected abstract static class PhraseWildcardQuery.PhraseTerm
    extends Object

All `PhraseWildcardQuery.PhraseTerm` are light and immutable. They do not hold query processing data such as `PhraseWildcardQuery.TermsData`. That way, the `PhraseWildcardQuery` is immutable and light itself and can be used safely as a key of the query cache.

### Field Summary

Fields
`protected int` `termPosition`

### Constructor Summary

Constructors
`protected` `PhraseTerm(int termPosition)`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`protected abstract int` `collectTermData(PhraseWildcardQuery query, IndexSearcher searcher, List<LeafReaderContext> segments, int remainingMultiTerms, int maxExpansionsForTerm, PhraseWildcardQuery.TermsData termsData)` Collects `TermState` and `TermStatistics` for the term (potentially expanded).
`protected int` `collectTermData(PhraseWildcardQuery query, IndexSearcher searcher, List<LeafReaderContext> segments, PhraseWildcardQuery.TermsData termsData)` Collects `TermState` and `TermStatistics` for the term without expansion.
`abstract boolean` `equals(Object o)`
`protected abstract Query` `getQuery()`
`protected abstract boolean` `hasExpansions()`
`abstract int` `hashCode()`
`protected abstract void` `toString(StringBuilder builder)`

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

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

### Field Detail

#### termPosition

    protected final int termPosition

### Constructor Detail

#### PhraseTerm

    protected PhraseTerm(int termPosition)

### Method Detail

#### hasExpansions

    protected abstract boolean hasExpansions()

#### getQuery

    protected abstract Query getQuery()

#### collectTermData

    protected int collectTermData(PhraseWildcardQuery query,
                                  IndexSearcher searcher,
                                  List<LeafReaderContext> segments,
                                  PhraseWildcardQuery.TermsData termsData)
                           throws IOException

Collects `TermState` and `TermStatistics` for the term without expansion. It must be called only if `hasExpansions()` returns false. Simplified version of `#collectTermData(PhraseWildcardQuery, IndexSearcher, List, int, int, TermsData)` with less arguments. This method throws `UnsupportedOperationException` if not overridden.

Throws:
  `IOException`

#### collectTermData

    protected abstract int collectTermData(PhraseWildcardQuery query,
                                           IndexSearcher searcher,
                                           List<LeafReaderContext> segments,
                                           int remainingMultiTerms,
                                           int maxExpansionsForTerm,
                                           PhraseWildcardQuery.TermsData termsData)
                                    throws IOException

Collects `TermState` and `TermStatistics` for the term (potentially expanded).

Parameters:
  `termsData` - `PhraseWildcardQuery.TermsData` to update with the collected terms and stats.
Returns:
  The number of expansions or matches in all segments; or 0 if this term does not match in any segment, in this case the phrase query can immediately stop.
Throws:
  `IOException`

#### toString

    protected abstract void toString(StringBuilder builder)

#### equals

    public abstract boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public abstract int hashCode()

Overrides:
  `hashCode` in class `Object`