org.apache.nutch.searcher
Class HitDetails

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

public final class HitDetails
extends Object
implements Writable

Data stored in the index for a hit.

Represented as a list of name/value pairs.


Constructor Summary
HitDetails()
           
HitDetails(String[] fields, String[] values)
          Construct from field names and values arrays.
HitDetails(String segment, String url)
          Construct minimal details from a segment name and document number.
 
Method Summary
 String getField(int i)
          Returns the name of the ith field.
 int getLength()
          Returns the number of fields contained in this.
 String getValue(int i)
          Returns the value of the ith field.
 String getValue(String field)
          Returns the value of the first field with the specified name.
 String[] getValues(String field)
          Returns all the values with the specified name.
static HitDetails read(DataInput in)
          Constructs, reads and returns an instance.
 void readFields(DataInput in)
           
 String toHtml()
          Display as HTML.
 String toString()
          Display as a string.
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HitDetails

public HitDetails()

HitDetails

public HitDetails(String[] fields,
                  String[] values)
Construct from field names and values arrays.


HitDetails

public HitDetails(String segment,
                  String url)
Construct minimal details from a segment name and document number.

Method Detail

getLength

public int getLength()
Returns the number of fields contained in this.


getField

public String getField(int i)
Returns the name of the ith field.


getValue

public String getValue(int i)
Returns the value of the ith field.


getValue

public String getValue(String field)
Returns the value of the first field with the specified name.


getValues

public String[] getValues(String field)
Returns all the values with the specified name.


write

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

read

public static HitDetails read(DataInput in)
                       throws IOException
Constructs, reads and returns an instance.

Throws:
IOException

readFields

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

toString

public String toString()
Display as a string.

Overrides:
toString in class Object

toHtml

public String toHtml()
Display as HTML.



Copyright © 2006 The Apache Software Foundation