/** * Return topic for the specified facet and topic name. * * @param facetName name of the wanted facet * @param topicName name of the wanted topic * @return topic */ public FacetTopic getTopic(String facetName, String topicName) { FacetTopic result = getFacetsAsMap().get(facetName).get(topicName); return result; }
/** * Return topic count for the specified facet and topic name. If facet or * topic don't exist, return 0. * * @param facetName name of the wanted facet * @param topicName name of the wanted topic * @return topic count or 0 */ public int getTopicCount(String facetName, String topicName) { int result = 0; if (getFacetsAsMap() != null) { Map<String, FacetTopic> topics = getFacetsAsMap().get(facetName); if (topics != null) { FacetTopic topic = topics.get(topicName); if (topic != null) { result = topic.getCount(); } } } return result; }