Class AdaptingHits
- java.lang.Object
 - 
- org.apache.jackrabbit.core.query.lucene.hits.AdaptingHits
 
 
- 
- All Implemented Interfaces:
 Hits
public class AdaptingHits extends Object implements Hits
This is an implementation of Hits which starts with marking hits in an ArrayHits instance and switches to a BitSetHits instance if at least the threshold of 8kb for the ArrayHits is reached and a BitSetHits instance would consume less memory. 
- 
- 
Constructor Summary
Constructors Constructor Description AdaptingHits()AdaptingHits(int threshold) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intnext()Return the doc number of the next hit in the set.voidset(int doc)Marks the document with doc numberdocas a hit.intskipTo(int target)Skips to the first match beyond the current whose document number is greater than or equal to the given target. 
 - 
 
- 
- 
Method Detail
- 
next
public int next() throws IOExceptionReturn the doc number of the next hit in the set. Subsequent calls never return the same doc number.- Specified by:
 nextin interfaceHits- Throws:
 IOException
 
- 
set
public void set(int doc)
Marks the document with doc numberdocas a hit. Implementations may throw an exception if you call set() after next() or skipTo() has been called. 
- 
skipTo
public int skipTo(int target) throws IOExceptionSkips to the first match beyond the current whose document number is greater than or equal to the given target. Returns -1 if there is no matching document number greater than target.- Specified by:
 skipToin interfaceHits- Throws:
 IOException
 
 - 
 
 -