2010-01-27 08:52:05 +01:00
|
|
|
package com.metaweb.gridlock.browsing.facets;
|
|
|
|
|
2010-01-28 02:43:09 +01:00
|
|
|
import java.util.Properties;
|
|
|
|
|
|
|
|
import org.json.JSONException;
|
|
|
|
import org.json.JSONObject;
|
|
|
|
|
2010-01-27 23:27:22 +01:00
|
|
|
import com.metaweb.gridlock.browsing.accessors.DecoratedValue;
|
|
|
|
|
2010-01-27 08:52:05 +01:00
|
|
|
public class NominalFacetChoice {
|
2010-01-27 23:27:22 +01:00
|
|
|
final public DecoratedValue decoratedValue;
|
|
|
|
public int count;
|
2010-01-28 02:43:09 +01:00
|
|
|
public boolean selected;
|
2010-01-27 23:27:22 +01:00
|
|
|
|
2010-01-28 02:43:09 +01:00
|
|
|
public NominalFacetChoice(DecoratedValue decoratedValue) {
|
2010-01-27 23:27:22 +01:00
|
|
|
this.decoratedValue = decoratedValue;
|
2010-01-28 02:43:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public JSONObject getJSON(Properties options) throws JSONException {
|
|
|
|
JSONObject o = new JSONObject();
|
|
|
|
|
|
|
|
o.put("v", decoratedValue.getJSON(options));
|
|
|
|
o.put("c", count);
|
|
|
|
o.put("s", selected);
|
|
|
|
|
|
|
|
return o;
|
2010-01-27 23:27:22 +01:00
|
|
|
}
|
2010-01-27 08:52:05 +01:00
|
|
|
}
|