com.googlecode.fascinator.common.solr
Class SolrFacet

java.lang.Object
  extended by com.googlecode.fascinator.common.solr.SolrFacet

public class SolrFacet
extends java.lang.Object

An extension of the JsonSimple class specifically to address Solr result facets and shortcut common access.

Author:
Greg Pendlebury

Constructor Summary
SolrFacet(java.lang.String field, org.json.simple.JSONArray data)
          Wrap a JSONArray in this class
 
Method Summary
 java.lang.Integer count(java.lang.String value)
          Get the count against a given facet value for this field.
 java.lang.String field()
          Get the name of the facet field
 java.util.Map<java.lang.String,java.lang.Integer> values()
          Get a Map containing facet values and counts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SolrFacet

public SolrFacet(java.lang.String field,
                 org.json.simple.JSONArray data)
Wrap a JSONArray in this class

Parameters:
newJsonObject - : The JSONArray to wrap
Method Detail

count

public java.lang.Integer count(java.lang.String value)
Get the count against a given facet value for this field.

Returns:
Integer : The required facet count

field

public java.lang.String field()
Get the name of the facet field

Returns:
String : The field name of this facet

values

public java.util.Map<java.lang.String,java.lang.Integer> values()
Get a Map containing facet values and counts. Internal representation is a LinkedHashMap to maintain original order.

Returns:
Map : The facet data for this field


Copyright © 2009-2013. All Rights Reserved.