org.jbox.searcher
Class HighLight

java.lang.Object
  extended by org.jbox.searcher.HighLight

public class HighLight
extends java.lang.Object

An class used to mark the key words with highlight.

Version:
1.0
Author:
YiBin.H

Constructor Summary
HighLight()
           
 
Method Summary
 java.lang.String highLight(java.lang.String text, java.lang.String query, java.awt.Color c)
          Cut the query string into words, and then mark the words highlight with Specified Color.
 void setCutterBox(CutterBox cb)
          Set a CutterBox object for analyzing the query string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HighLight

public HighLight()
Method Detail

highLight

public java.lang.String highLight(java.lang.String text,
                                  java.lang.String query,
                                  java.awt.Color c)
Cut the query string into words, and then mark the words highlight with Specified Color. Note,What does Highlight object do is just replace all the key words in the text with specified color: keyword---><font color="xxxxxx">keyword</font>

Parameters:
text - text needed to highlight the query words in it.
query - query string.
c - Color.
Returns:
string with query words highlight in it.

setCutterBox

public void setCutterBox(CutterBox cb)
Set a CutterBox object for analyzing the query string.

Parameters:
cb - CutterBox object.