com.atlassian.jira.issue.statistics.util
Class OneDimensionalObjectHitCollector

java.lang.Object
  extended by org.apache.lucene.search.HitCollector
      extended by com.atlassian.jira.issue.statistics.util.OneDimensionalObjectHitCollector

public class OneDimensionalObjectHitCollector
extends org.apache.lucene.search.HitCollector

A HitCollector that creates a doc -> object mapping. This is useful for collecting documents where there are a limited number of terms. The caching also ensures that if multiple searches sort on the same terms, the doc -> object mapping is maintained.

This HitCollector can be quite memory intensive, however the cache is stored with a weak reference, so it will be garbage collected.

This HitCollector differs from OneDimensionalTermHitCollector in that it performs the term -> object conversion here, rather than later. This is more expensive, but useful for StatisticsMappers that perform some sort of runtime conversion / translation (eg a StatisticsMapper that groups dates by Month, or groups users by email domain name).


Constructor Summary
OneDimensionalObjectHitCollector(StatisticsMapper statisticsMapper, Map result, org.apache.lucene.index.IndexReader indexReader)
           
 
Method Summary
 void collect(int i, float v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OneDimensionalObjectHitCollector

public OneDimensionalObjectHitCollector(StatisticsMapper statisticsMapper,
                                        Map result,
                                        org.apache.lucene.index.IndexReader indexReader)
Method Detail

collect

public void collect(int i,
                    float v)
Specified by:
collect in class org.apache.lucene.search.HitCollector


Copyright © 2002-2008 Atlassian. All Rights Reserved.