SMILA (incubation) API documentation

org.eclipse.smila.search.api.helper
Class Facets

java.lang.Object
  extended by org.eclipse.smila.search.api.helper.AnnotationListAccessor
      extended by org.eclipse.smila.search.api.helper.Facets

public class Facets
extends AnnotationListAccessor

wrapper for annotations describing search facets (grouping, categorization, questions).

Author:
jschumacher

Constructor Summary
Facets(java.lang.String attributeName, java.util.Collection<Annotation> annotations)
          create instance from data.
Facets(java.lang.String attributeName, java.util.List<Annotation> annotations)
          create instance from data.
 
Method Summary
 java.lang.Integer getCount(int index)
          get count property of n'th facet.
 java.lang.String getName(int index)
          get name property of n'th facet.
 Annotation getObjectFilter(int index)
          get filter subannotation of n'th facet.
 java.lang.String getStringFilter(int index)
          get value of string filter property of n'th facet.
 java.util.Map<java.lang.String,Facets> getSubFacets(int index)
          get subfacets of n'th facet.
 boolean hasSubFacets(int index)
          check if the n'th facet has subfacets.
 
Methods inherited from class org.eclipse.smila.search.api.helper.AnnotationListAccessor
getAnnotation, getAnnotations, getAttributeName, getFloatProperty, getIntProperty, getProperty, getSource, length
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Facets

public Facets(java.lang.String attributeName,
              java.util.List<Annotation> annotations)
create instance from data.

Parameters:
attributeName - name of faceted attribute
annotations - list of facet annotations.

Facets

public Facets(java.lang.String attributeName,
              java.util.Collection<Annotation> annotations)
create instance from data.

Parameters:
attributeName - name of faceted attribute
annotations - collection of facet annotations.
Method Detail

getName

public java.lang.String getName(int index)
get name property of n'th facet.

Parameters:
index - position in facet list.
Returns:
name of facet, or null for invalid indexes

getStringFilter

public java.lang.String getStringFilter(int index)
get value of string filter property of n'th facet.

Parameters:
index - position in facet list.
Returns:
string filter of facet, or null for invalid indexes.

getObjectFilter

public Annotation getObjectFilter(int index)
get filter subannotation of n'th facet.

Parameters:
index - position in facet list.
Returns:
object filter of facet, or null for invalid indexes.

getCount

public java.lang.Integer getCount(int index)
get count property of n'th facet.

Parameters:
index - position in facet list.
Returns:
count of facet, or null for invalid indexes

hasSubFacets

public boolean hasSubFacets(int index)
check if the n'th facet has subfacets.

Parameters:
index - position in facet list.
Returns:
true if the n'th facet has subfacets, else false.

getSubFacets

public java.util.Map<java.lang.String,Facets> getSubFacets(int index)
get subfacets of n'th facet.

Parameters:
index - position in facet list.
Returns:
map of attribute names to subfacet lists. If no subfacets exists, an empty map is returned.

SMILA (incubation) API documentation