SpanGradientFormatter (Lucene 2.4.1 API)
Keywords: org.apache.lucene.search.highlight.SpanGradientFormatter class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.lucene.search.highlight
Class SpanGradientFormatter

    java.lang.Object
      org.apache.lucene.search.highlight.GradientFormatter
          org.apache.lucene.search.highlight.SpanGradientFormatter

All Implemented Interfaces:
  Formatter

    public class SpanGradientFormatter

extends GradientFormatter

Formats text with different color intensity depending on the score of the term using the span tag. GradientFormatter uses a bgcolor argument to the font tag which doesn't work in Mozilla, thus this class.

See Also:
  `GradientFormatter`

Field Summary

Fields inherited from class org.apache.lucene.search.highlight.GradientFormatter
`highlightBackground, highlightForeground`

Constructor Summary
`SpanGradientFormatter(float maxScore, String minForegroundColor, String maxForegroundColor, String minBackgroundColor, String maxBackgroundColor)`

Method Summary
`String` | `highlightTerm(String originalText, TokenGroup tokenGroup)`

Methods inherited from class org.apache.lucene.search.highlight.GradientFormatter
`getBackgroundColorString, getForegroundColorString, hexToInt`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SpanGradientFormatter

    public SpanGradientFormatter(float maxScore,
                                 String minForegroundColor,
                                 String maxForegroundColor,
                                 String minBackgroundColor,
                                 String maxBackgroundColor)

Method Detail

### highlightTerm

    public String highlightTerm(String originalText,
                                TokenGroup tokenGroup)

  Specified by:
    `highlightTerm` in interface `Formatter`
  Overrides:
    `highlightTerm` in class `GradientFormatter`
  Parameters:
    `originalText` - The section of text being considered for markup
    `tokenGroup` - contains one or several overlapping Tokens along with their scores and positions.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.