Class FilteredIntervalsSource
- java.lang.Object
-
- org.apache.lucene.queries.intervals.IntervalsSource
-
- org.apache.lucene.queries.intervals.FilteredIntervalsSource
-
- Direct Known Subclasses:
FilteredIntervalsSource.MaxGaps,FilteredIntervalsSource.MaxWidth
public abstract class FilteredIntervalsSource extends IntervalsSource
An IntervalsSource that filters the intervals from another IntervalsSource
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classFilteredIntervalsSource.MaxGapsprivate static classFilteredIntervalsSource.MaxWidth
-
Field Summary
Fields Modifier and Type Field Description protected IntervalsSourceinprivate java.lang.Stringname
-
Constructor Summary
Constructors Constructor Description FilteredIntervalsSource(java.lang.String name, IntervalsSource in)Create a new FilteredIntervalsSource
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract booleanaccept(IntervalIterator it)booleanequals(java.lang.Object o)inthashCode()IntervalIteratorintervals(java.lang.String field, LeafReaderContext ctx)Create anIntervalIteratorexposing the minimum intervals defined by thisIntervalsSourceIntervalMatchesIteratormatches(java.lang.String field, LeafReaderContext ctx, int doc)Return aMatchesIteratorover the intervals defined by thisIntervalsSourcefor a given document and fieldstatic IntervalsSourcemaxGaps(IntervalsSource in, int maxGaps)static IntervalsSourcemaxWidth(IntervalsSource in, int maxWidth)intminExtent()Return the minimum possible width of an interval returned by this sourcejava.util.Collection<IntervalsSource>pullUpDisjunctions()Expert: return the set of disjunctions that make up this IntervalsSourcejava.lang.StringtoString()voidvisit(java.lang.String field, QueryVisitor visitor)Expert: visit the tree of sources
-
-
-
Field Detail
-
name
private final java.lang.String name
-
in
protected final IntervalsSource in
-
-
Constructor Detail
-
FilteredIntervalsSource
public FilteredIntervalsSource(java.lang.String name, IntervalsSource in)Create a new FilteredIntervalsSource- Parameters:
name- the name of the filterin- the source to filter
-
-
Method Detail
-
maxGaps
public static IntervalsSource maxGaps(IntervalsSource in, int maxGaps)
-
maxWidth
public static IntervalsSource maxWidth(IntervalsSource in, int maxWidth)
-
accept
protected abstract boolean accept(IntervalIterator it)
- Returns:
falseif the current interval should be filtered out
-
intervals
public IntervalIterator intervals(java.lang.String field, LeafReaderContext ctx) throws java.io.IOException
Description copied from class:IntervalsSourceCreate anIntervalIteratorexposing the minimum intervals defined by thisIntervalsSourceReturns
nullif no intervals for this field exist in this segment- Specified by:
intervalsin classIntervalsSource- Parameters:
field- the field to read positions fromctx- the context for which to return the iterator- Throws:
java.io.IOException
-
matches
public IntervalMatchesIterator matches(java.lang.String field, LeafReaderContext ctx, int doc) throws java.io.IOException
Description copied from class:IntervalsSourceReturn aMatchesIteratorover the intervals defined by thisIntervalsSourcefor a given document and fieldReturns
nullif no intervals exist in the given document and field- Specified by:
matchesin classIntervalsSource- Parameters:
field- the field to read positions fromctx- the document's contextdoc- the document to return matches for- Throws:
java.io.IOException
-
minExtent
public int minExtent()
Description copied from class:IntervalsSourceReturn the minimum possible width of an interval returned by this source- Specified by:
minExtentin classIntervalsSource
-
pullUpDisjunctions
public java.util.Collection<IntervalsSource> pullUpDisjunctions()
Description copied from class:IntervalsSourceExpert: return the set of disjunctions that make up this IntervalsSourceMost implementations can return
Collections.singleton(this)- Specified by:
pullUpDisjunctionsin classIntervalsSource
-
visit
public void visit(java.lang.String field, QueryVisitor visitor)Description copied from class:IntervalsSourceExpert: visit the tree of sources- Specified by:
visitin classIntervalsSource
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equalsin classIntervalsSource
-
hashCode
public int hashCode()
- Specified by:
hashCodein classIntervalsSource
-
toString
public java.lang.String toString()
- Specified by:
toStringin classIntervalsSource
-
-