|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@PublicSpi public interface LuceneFieldSorter<T>
Implementations of this interface are used to sort Lucene search results of Issue Documents.
NOTE: instances of this interface are cached by Lucene and are REUSED to sort multiple Lucene search results. The Comparator returned by thegetComparator()
method could be used by Lucene from multiple threads at once.
Therefore, the implementations of this interface MUST implement the Object.equals(Object)
and Object.hashCode()
methods correctly to ensure that Lucene can find the implementations of this class
in its cache and reuse it, rather than make the cache grow indefinitely. (Unfortunately the Lucene cache is rather
primitive at the moment, and is not bound).
Also, ensure that the Comparator
returned by the getComparator()
method is thread
safe.
As instances of this and the Comparator
returned by this object are cached and reused by Lucene to sort
multiple search results, the best thing to do is to ensure the implementations of this interface and the
Comparator
that is returned are immutable and that the equals(Object)
and
hashCode()
methods respect the state of the object.
Method Summary | |
---|---|
boolean |
equals(Object obj)
As this object is used as a key in a cache, this method must be provided and respect all internal state. |
Comparator<T> |
getComparator()
A comparator that can be used to order objects returned by getValueFromLuceneField(String) . |
String |
getDocumentConstant()
Get the constant that this field is indexed with. |
T |
getValueFromLuceneField(String documentValue)
Convert the lucene document field back to the object that you wish to use to display it. |
int |
hashCode()
As this object is used as a key in a cache, this method must be provided and respect all internal state. |
Method Detail |
---|
String getDocumentConstant()
IssueDocument
,
CustomFieldSearcher
T getValueFromLuceneField(String documentValue)
eg. '1000' -> Version 1.
This does the reverse of what IssueDocument
does.
For custom fields, the return value will be passed to
CustomFieldSearcherModuleDescriptor.getStatHtml(com.atlassian.jira.issue.fields.CustomField, Object, String)
documentValue
- The value of the field in the lucene index
Comparator<T> getComparator()
getValueFromLuceneField(String)
.
The Comparator must be reentrant as it could be used by Lucene from multiple threads at once.
boolean equals(Object obj)
equals
in class Object
int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |