org.apache.nutch.searcher
Class Hits

java.lang.Object
  extended by org.apache.nutch.searcher.Hits
All Implemented Interfaces:
Writable

public final class Hits
extends Object
implements Writable

A set of hits matching a query.


Constructor Summary
Hits()
           
Hits(long total, Hit[] top)
           
 
Method Summary
 Hit getHit(int i)
          Returns the ith hit in this list.
 Hit[] getHits(int start, int length)
          Returns a subset of the hit objects.
 int getLength()
          Returns the number of hits included in this current listing.
 long getTotal()
          Returns the total number of hits for this query.
 void readFields(DataInput in)
           
 void setTotalIsExact(boolean isExact)
          Set totalIsExact().
 boolean totalIsExact()
          True if getTotal() gives the exact number of hits, or false if it is only an estimate of the total number of hits.
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hits

public Hits()

Hits

public Hits(long total,
            Hit[] top)
Method Detail

getTotal

public long getTotal()
Returns the total number of hits for this query. This may be an estimate when (@link #totalIsExact()} is false.


totalIsExact

public boolean totalIsExact()
True if getTotal() gives the exact number of hits, or false if it is only an estimate of the total number of hits.


setTotalIsExact

public void setTotalIsExact(boolean isExact)
Set totalIsExact().


getLength

public int getLength()
Returns the number of hits included in this current listing.


getHit

public Hit getHit(int i)
Returns the ith hit in this list.


getHits

public Hit[] getHits(int start,
                     int length)
Returns a subset of the hit objects.


write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface Writable
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface Writable
Throws:
IOException


Copyright © 2006 The Apache Software Foundation