com.browseengine.bobo.facets.impl
Class HistogramFacetHandler.HistogramCollector<T extends Number>

java.lang.Object
  extended by com.browseengine.bobo.facets.impl.HistogramFacetHandler.HistogramCollector<T>
All Implemented Interfaces:
FacetAccessible, FacetCountCollector
Enclosing class:
HistogramFacetHandler<T extends Number>

public static class HistogramFacetHandler.HistogramCollector<T extends Number>
extends Object
implements FacetCountCollector


Field Summary
 
Fields inherited from interface com.browseengine.bobo.facets.FacetCountCollector
EMPTY_FACET_LIST
 
Constructor Summary
protected HistogramFacetHandler.HistogramCollector(String facetName, FacetCountCollector baseCollector, FacetDataCache<?> dataCache, FacetSpec ospec, T start, T end, T unit)
           
 
Method Summary
 void close()
          Responsible for release resources used.
 void collect(int docid)
          Collect a hit.
 void collectAll()
          Collects all hits.
 int[] getCountDistribution()
          not supported
 BrowseFacet getFacet(String value)
          Gets the facet given a value.
 List<BrowseFacet> getFacets()
          Gets gathered top facets
 String getName()
          Gets the name of the facet
 FacetIterator iterator()
          Returns an iterator to visit all the facets
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HistogramFacetHandler.HistogramCollector

protected HistogramFacetHandler.HistogramCollector(String facetName,
                                                   FacetCountCollector baseCollector,
                                                   FacetDataCache<?> dataCache,
                                                   FacetSpec ospec,
                                                   T start,
                                                   T end,
                                                   T unit)
Method Detail

getCountDistribution

public int[] getCountDistribution()
not supported

Specified by:
getCountDistribution in interface FacetCountCollector
Returns:
integer array of count values representing distribution of the facet values.

getFacet

public BrowseFacet getFacet(String value)
Description copied from interface: FacetAccessible
Gets the facet given a value. This is a way for random accessing into the facet data structure.

Specified by:
getFacet in interface FacetAccessible
Parameters:
value - Facet value
Returns:
a facet with count filled in

collect

public final void collect(int docid)
Description copied from interface: FacetCountCollector
Collect a hit. This is called for every hit, thus the implementation needs to be super-optimized.

Specified by:
collect in interface FacetCountCollector
Parameters:
docid - doc

collectAll

public final void collectAll()
Description copied from interface: FacetCountCollector
Collects all hits. This is called once per request by the facet engine in certain scenarios.

Specified by:
collectAll in interface FacetCountCollector

getFacets

public List<BrowseFacet> getFacets()
Description copied from interface: FacetAccessible
Gets gathered top facets

Specified by:
getFacets in interface FacetAccessible
Returns:
list of facets

iterator

public FacetIterator iterator()
Description copied from interface: FacetAccessible
Returns an iterator to visit all the facets

Specified by:
iterator in interface FacetAccessible
Returns:
Returns a FacetIterator to iterate over all the facets

getName

public String getName()
Description copied from interface: FacetCountCollector
Gets the name of the facet

Specified by:
getName in interface FacetCountCollector
Returns:
facet name

close

public void close()
Description copied from interface: FacetAccessible
Responsible for release resources used. If the implementing class does not use a lot of resources, it does not have to do anything.

Specified by:
close in interface FacetAccessible


Copyright © 2011. All Rights Reserved.