se.l4.silo.search.FacetsImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of silo-search-api Show documentation
Show all versions of silo-search-api Show documentation
API for Lucene-based querying for Silo.
package se.l4.silo.search;
import java.util.List;
import com.google.common.collect.ArrayListMultimap;
public class FacetsImpl
implements Facets
{
private final ArrayListMultimap items;
public FacetsImpl()
{
items = ArrayListMultimap.create();
}
@Override
public List get(String id)
{
return items.get(id);
}
public void add(String facet, String label, int count, Object extra)
{
items.put(facet, new DefaultFacetEntry(label, count, extra));
}
public void addAll(String facet, List entries)
{
items.putAll(facet, entries);
}
@Override
public String toString()
{
return getClass().getSimpleName() + items;
}
}