| java.lang.Object org.apache.lucene.search.highlight.GradientFormatter
All known Subclasses: org.apache.lucene.search.highlight.SpanGradientFormatter,
GradientFormatter | public class GradientFormatter implements Formatter(Code) | | Formats text with different color intensity depending on the score of the
term.
author: maharwood |
bgRMaxbgGMaxbgBMax | int bgRMaxbgGMaxbgBMax(Code) | | |
bgRMinbgGMinbgBMin | int bgRMinbgGMinbgBMin(Code) | | |
fgRMaxfgGMaxfgBMax | int fgRMaxfgGMaxfgBMax(Code) | | |
fgRMinfgGMinfgBMin | int fgRMinfgGMinfgBMin(Code) | | |
highlightBackground | protected boolean highlightBackground(Code) | | |
highlightForeground | protected boolean highlightForeground(Code) | | |
GradientFormatter | public GradientFormatter(float maxScore, String minForegroundColor, String maxForegroundColor, String minBackgroundColor, String maxBackgroundColor)(Code) | | Sets the color range for the IDF scores
Parameters: maxScore - The score (and above) displayed as maxColor (SeeQueryScorer.getMaxWeight which can be used to callibrate scoringscale) Parameters: minForegroundColor - The hex color used for representing IDF scores of zero eg #FFFFFF(white) or null if no foreground color required Parameters: maxForegroundColor - The largest hex color used for representing IDF scores eg #000000(black) or null if no foreground color required Parameters: minBackgroundColor - The hex color used for representing IDF scores of zero eg #FFFFFF(white) or null if no background color required Parameters: maxBackgroundColor - The largest hex color used for representing IDF scores eg #000000(black) or null if no background color required |
getBackgroundColorString | protected String getBackgroundColorString(float score)(Code) | | |
getForegroundColorString | protected String getForegroundColorString(float score)(Code) | | |
hexToInt | final public static int hexToInt(String hex)(Code) | | Converts a hex string into an int. Integer.parseInt(hex, 16) assumes the
input is nonnegative unless there is a preceding minus sign. This method
reads the input as twos complement instead, so if the input is 8 bytes
long, it will correctly restore a negative int produced by
Integer.toHexString() but not neccesarily one produced by
Integer.toString(x,16) since that method will produce a string like '-FF'
for negative integer values.
Parameters: hex - A string in capital or lower case hex, of no more then 16characters. throws: NumberFormatException - if the string is more than 16 characters long, or if anycharacter is not in the set [0-9a-fA-f] |
|
|