com.facetmap.simple
Class FacetBuilder
java.lang.Object
com.facetmap.simple.FacetBuilder
public class FacetBuilder
- extends java.lang.Object
Accepts repeated input of values that represent Headings mapped to
Resources, and spits out Facet data containing the appropriate Headings.
The type and structure of the output Facet can (in future releases)
be controlled by properties, but the default behavior is for
parseResourceHeadingValue(String) to be somewhat
intelligent about the type of Facet desired.
For example, if only numbers are input, a SpectrumFacet will be
created. If only Dates are input, a DateFacet will be created.
A mixture of input types usually results in a TaxonomyFacet.
To create a CompoundHeadingFacet (thus allowing multiple headings from
a facet to be set on a resource), you must explicitly call
allowCompoundHeadings, as it is not possible to determine
this information from input headings.
|
Constructor Summary |
FacetBuilder()
Create a new FacetBuilder, ready to accept Heading values. |
FacetBuilder(java.util.Properties properties)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
values
protected java.util.Set values
props
protected java.util.Properties props
id
protected java.lang.String id
title
protected java.lang.String title
facetType
protected java.lang.Class facetType
allowCompoundHeadings
protected boolean allowCompoundHeadings
FacetBuilder
public FacetBuilder()
- Create a new FacetBuilder, ready to accept Heading values.
FacetBuilder
public FacetBuilder(java.util.Properties properties)
setId
public void setId(java.lang.String id)
setTitle
public void setTitle(java.lang.String title)
parseResourceHeadingValue
public void parseResourceHeadingValue(java.lang.String value)
- This adds a heading value, but first parses the input string to see if
it's more specialized data than just a string token.
addResourceHeadingValue
public void addResourceHeadingValue(java.lang.String value)
addResourceHeadingValue
public void addResourceHeadingValue(int value)
addResourceHeadingValue
public void addResourceHeadingValue(java.util.Date value)
generateFacet
public Facet generateFacet()
getMinAndMaxInts
public int[] getMinAndMaxInts(java.util.Collection integers)
getMinAndMaxDates
public java.util.Date[] getMinAndMaxDates(java.util.Collection dates)
allowCompoundHeadings
public void allowCompoundHeadings()
disallowCompoundHeadings
public void disallowCompoundHeadings()
getId
public java.lang.String getId()
getTitle
public java.lang.String getTitle()