SMILA (incubation) API documentation

org.eclipse.smila.search.api.helper
Class HighlightInfo

java.lang.Object
  extended by org.eclipse.smila.search.api.helper.HighlightInfo

public class HighlightInfo
extends java.lang.Object

wrapper for highlight information annotations.

Author:
jschumacher

Constructor Summary
HighlightInfo(java.lang.String attributeName, Annotation annotation)
          create instance from data.
 
Method Summary
 java.lang.String getAttributeName()
           
 java.lang.Integer getEndPos(int index)
          get end character position property of n'th highlight position.
 java.lang.String getMethod(int index)
          get method property of n'th highlight position.
 java.lang.String getProperty(int index, java.lang.String name)
          get named property of n'th highlight position.
 java.lang.String getProperty(java.lang.String name)
          access named value of highlight annotation.
 java.lang.Double getQuality(int index)
          get quality property of n'th highlight position.
 java.lang.Integer getQueryGroup(int index)
          get group property of n'th highlight position.
 Annotation getSource()
          access to original object.
 java.lang.Integer getStartPos(int index)
          get start character position property of n'th highlight position.
 java.lang.String getText()
          access text property of highlight annotation.
 boolean isHighlighted()
          check if the text property contains already highlighted text, or the plain text to be highlighted by the client using the info from the position list.
 int positionLength()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HighlightInfo

public HighlightInfo(java.lang.String attributeName,
                     Annotation annotation)
create instance from data.

Parameters:
attributeName - annotated attribute (can be null for record annotations).
annotation - the highlight annotations.
Method Detail

getAttributeName

public java.lang.String getAttributeName()
Returns:
name of annotated attribute.

getProperty

public java.lang.String getProperty(java.lang.String name)
access named value of highlight annotation.

Parameters:
name - name of property
Returns:
value of property.

getText

public java.lang.String getText()
access text property of highlight annotation.

Returns:
text property.

isHighlighted

public boolean isHighlighted()
check if the text property contains already highlighted text, or the plain text to be highlighted by the client using the info from the position list.

Returns:
true if text is highlighted already.

positionLength

public int positionLength()
Returns:
number of highlight positions.

getStartPos

public java.lang.Integer getStartPos(int index)
get start character position property of n'th highlight position.

Parameters:
index - position in term list.
Returns:
start character position of highlight position, or null for invalid indexes

getEndPos

public java.lang.Integer getEndPos(int index)
get end character position property of n'th highlight position.

Parameters:
index - position in term list.
Returns:
start character position of highlight position, or null for invalid indexes

getQuality

public java.lang.Double getQuality(int index)
get quality property of n'th highlight position.

Parameters:
index - position in term list.
Returns:
quality of highlight position, or null for invalid indexes

getQueryGroup

public java.lang.Integer getQueryGroup(int index)
get group property of n'th highlight position.

Parameters:
index - position in term list.
Returns:
group of highlight position, or null for invalid indexes

getMethod

public java.lang.String getMethod(int index)
get method property of n'th highlight position.

Parameters:
index - position in term list.
Returns:
method of highlight position, or null for invalid indexes

getProperty

public java.lang.String getProperty(int index,
                                    java.lang.String name)
get named property of n'th highlight position.

Parameters:
index - position in term list.
name - name of property.
Returns:
named property or null for invalid indexes

getSource

public Annotation getSource()
access to original object.

Returns:
the underlying highlight info annotation.

SMILA (incubation) API documentation