org.apache.nutch.searcher
Class Summary

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

public class Summary
extends Object
implements Writable

A document summary dynamically generated to match a query.


Nested Class Summary
static class Summary.Ellipsis
          An ellipsis fragment within a summary.
static class Summary.Fragment
          A fragment of text within a summary.
static class Summary.Highlight
          A highlighted fragment of text within a summary.
 
Constructor Summary
Summary()
          Constructs an empty Summary.
 
Method Summary
 void add(Summary.Fragment fragment)
          Adds a fragment to a summary.
 boolean equals(Object o)
           
 Summary.Fragment[] getFragments()
          Returns an array of all of this summary's fragments.
static Summary read(DataInput in)
           
 void readFields(DataInput in)
           
 String toHtml(boolean encode)
          Returns a HTML representation of this Summary.
 String toString()
          Returns a String representation of this Summary.
static String[] toStrings(Summary[] summaries)
          Helper method that return a String representation for each specified Summary.
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Summary

public Summary()
Constructs an empty Summary.

Method Detail

add

public void add(Summary.Fragment fragment)
Adds a fragment to a summary.


getFragments

public Summary.Fragment[] getFragments()
Returns an array of all of this summary's fragments.


toString

public String toString()
Returns a String representation of this Summary.

Overrides:
toString in class Object

toHtml

public String toHtml(boolean encode)
Returns a HTML representation of this Summary. HTML output for Highlight fragments is <span class="highlight">highlight's text</span>, for Ellipsis fragments is <span class="highlight"> ... </span>, for generic Fragment is simply the fragment's text.

Parameters:
encode - specifies if the summary's entities should be encoded.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

toStrings

public static String[] toStrings(Summary[] summaries)
Helper method that return a String representation for each specified Summary.


read

public static Summary read(DataInput in)
                    throws IOException
Throws:
IOException

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