public abstract class DepthOneFacetResultsHandler extends FacetResultsHandler
FacetResultsHandler
which counts the top-K facets at depth 1 only
and always labels all result categories. The results are always sorted by
value, in descending order. Sub-classes are responsible to pull the values
from the corresponding FacetArrays
.facetArrays, facetRequest, taxonomyReader
Constructor and Description |
---|
DepthOneFacetResultsHandler(TaxonomyReader taxonomyReader,
FacetRequest facetRequest,
FacetArrays facetArrays) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
addSiblings(int ordinal,
int[] siblings,
ArrayList<FacetResultNode> nodes)
Add the siblings of
ordinal to the given list. |
protected abstract int |
addSiblings(int ordinal,
int[] siblings,
PriorityQueue<FacetResultNode> pq)
Add the siblings of
ordinal to the given PriorityQueue . |
FacetResult |
compute()
Computes the
FacetResult for the given FacetArrays . |
protected abstract double |
valueOf(int ordinal)
Returnt the value of the requested ordinal.
|
public DepthOneFacetResultsHandler(TaxonomyReader taxonomyReader, FacetRequest facetRequest, FacetArrays facetArrays)
protected abstract double valueOf(int ordinal)
protected abstract void addSiblings(int ordinal, int[] siblings, ArrayList<FacetResultNode> nodes) throws IOException
ordinal
to the given list. This is called
whenever the number of results is too high (> taxonomy size), instead of
adding them to a PriorityQueue
.IOException
protected abstract int addSiblings(int ordinal, int[] siblings, PriorityQueue<FacetResultNode> pq)
ordinal
to the given PriorityQueue
. The
given PriorityQueue
is already filled with sentinel objects, so
implementations are encouraged to use PriorityQueue.top()
and
PriorityQueue.updateTop()
for best performance. Returns the total
number of siblings.public final FacetResult compute() throws IOException
FacetResultsHandler
FacetResult
for the given FacetArrays
.compute
in class FacetResultsHandler
IOException
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.