org.apache.lucene.search.intervals

## Class FilteredIntervalsSource

- java.lang.Object
- - org.apache.lucene.search.intervals.IntervalsSource
  - - org.apache.lucene.search.intervals.FilteredIntervalsSource

-     public abstract class FilteredIntervalsSource
      extends IntervalsSource

  An IntervalsSource that filters the intervals from another IntervalsSource

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FilteredIntervalsSource(String name, IntervalsSource in)` Create a new FilteredIntervalsSource

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract boolean` | `accept(IntervalIterator it)`
    `boolean` | `equals(Object o)`
    `void` | `extractTerms(String field, Set<Term> terms)` Expert: collect `Term` objects from this source
    `int` | `hashCode()`
    `IntervalIterator` | `intervals(String field, LeafReaderContext ctx)` Create an `IntervalIterator` exposing the minimum intervals defined by this `IntervalsSource` Returns `null` if no intervals for this field exist in this segment
    `MatchesIterator` | `matches(String field, LeafReaderContext ctx, int doc)` Return a `MatchesIterator` over the intervals defined by this `IntervalsSource` for a given document and field Returns `null` if no intervals exist in the given document and field
    `int` | `minExtent()` Return the minimum possible width of an interval returned by this source
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### FilteredIntervalsSource

          public FilteredIntervalsSource(String name,
                                         IntervalsSource in)

      Create a new FilteredIntervalsSource
      Parameters:
        `name` - the name of the filter
        `in` - the source to filter

  - ### Method Detail

    - #### accept

          protected abstract boolean accept(IntervalIterator it)

      Returns:
        `false` if the current interval should be filtered out

    - #### intervals

          public IntervalIterator intervals(String field,
                                            LeafReaderContext ctx)
                                     throws IOException

      Description copied from class: `IntervalsSource`
      Create an `IntervalIterator` exposing the minimum intervals defined by this `IntervalsSource` Returns `null` if no intervals for this field exist in this segment
      Specified by:
        `intervals` in class `IntervalsSource`
      Parameters:
        `field` - the field to read positions from
        `ctx` - the context for which to return the iterator
      Throws:
        `IOException`

    - #### matches

          public MatchesIterator matches(String field,
                                         LeafReaderContext ctx,
                                         int doc)
                                  throws IOException

      Description copied from class: `IntervalsSource`
      Return a `MatchesIterator` over the intervals defined by this `IntervalsSource` for a given document and field Returns `null` if no intervals exist in the given document and field
      Specified by:
        `matches` in class `IntervalsSource`
      Parameters:
        `field` - the field to read positions from
        `ctx` - the document's context
        `doc` - the document to return matches for
      Throws:
        `IOException`

    - #### minExtent

          public int minExtent()

      Description copied from class: `IntervalsSource`
      Return the minimum possible width of an interval returned by this source
      Specified by:
        `minExtent` in class `IntervalsSource`

    - #### extractTerms

          public void extractTerms(String field,
                                   Set<Term> terms)

      Description copied from class: `IntervalsSource`
      Expert: collect `Term` objects from this source
      Specified by:
        `extractTerms` in class `IntervalsSource`
      Parameters:
        `field` - the field to be scored
        `terms` - a `Set` which terms should be added to

    - #### equals

          public boolean equals(Object o)

      Specified by:
        `equals` in class `IntervalsSource`

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in class `IntervalsSource`

    - #### toString

          public String toString()

      Specified by:
        `toString` in class `IntervalsSource`

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