com.browseengine.bobo.facets.impl
Class GeoSimpleFacetCountCollector

java.lang.Object
  extended by com.browseengine.bobo.facets.impl.GeoSimpleFacetCountCollector
All Implemented Interfaces:
FacetAccessible, FacetCountCollector

public class GeoSimpleFacetCountCollector
extends Object
implements FacetCountCollector

Author:
nnarkhed

Field Summary
 
Fields inherited from interface com.browseengine.bobo.facets.FacetCountCollector
EMPTY_FACET_LIST
 
Constructor Summary
protected GeoSimpleFacetCountCollector(String name, FacetDataCache latDataCache, FacetDataCache longDataCache, int docBase, FacetSpec spec, List<String> predefinedRanges)
           
 
Method Summary
 void close()
           
 void collect(int docid)
          Collect a hit.
 void collectAll()
          Collects all hits.
 int[] getCountDistribution()
          Returns an integer array representing the distribution function of a given facet.
 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

GeoSimpleFacetCountCollector

protected GeoSimpleFacetCountCollector(String name,
                                       FacetDataCache latDataCache,
                                       FacetDataCache longDataCache,
                                       int docBase,
                                       FacetSpec spec,
                                       List<String> predefinedRanges)
Method Detail

collect

public 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 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

getCountDistribution

public int[] getCountDistribution()
Description copied from interface: FacetCountCollector
Returns an integer array representing the distribution function of a given facet.

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

getName

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

Specified by:
getName in interface FacetCountCollector
Returns:
facet name

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

getFacets

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

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

close

public void close()
Specified by:
close in interface FacetAccessible

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


Copyright © 2011. All Rights Reserved.