com.facetmap
Interface Spectrum

All Superinterfaces:
Facet

public interface Spectrum
extends Facet

Represents a scalar Facet that doesn't necessarily have discrete Headings. This is a good structure for numerical headings, such as years, prices, heights, etc. The user, when browsing, will generally have the power to arbitrarily specify minimum and maximum values for this dimension in facetspace, so predefined Headings need not be created, though they can be. The visible light spectrum, though continuous, designates ranges of light wavelength, such as red (420-480), orange (480-540), etc. A FacetMap spectrum may do the same, and thereby predefine ranges: Headings with predefined titles. A year spectrum can define eras, a price spectrum can define price ranges, and so on. And these predefined ranges may nest, e.g. "Under $100" may contain "Bargains under $20".


Field Summary
static int LARGEST_MAXIMUM
           
static int SMALLEST_MINIMUM
          The allowable extremes are set so that the number of possible values in any range is a positive number.
 
Method Summary
 SpectrumHeading defineHeading(java.lang.String id, int min, int max)
          Explicitly define a heading within this Spectrum.
 int getDefinedHeadingCount()
           
 SpectrumHeading getHeading(int min, int max)
          Encapsulates a range of values in this Spectrum as a Heading.
 java.lang.String getTitleTemplate()
           
 void setTitleTemplate(java.lang.String template)
          Sets the title template for range Headings in this Spectrum.
 
Methods inherited from interface com.facetmap.Facet
doAddToFacetSpace, getHeading, getId, getRootHeading, getTitle, setTitle
 

Field Detail

SMALLEST_MINIMUM

public static final int SMALLEST_MINIMUM
The allowable extremes are set so that the number of possible values in any range is a positive number.

See Also:
Constant Field Values

LARGEST_MAXIMUM

public static final int LARGEST_MAXIMUM
See Also:
Constant Field Values
Method Detail

defineHeading

public SpectrumHeading defineHeading(java.lang.String id,
                                     int min,
                                     int max)
Explicitly define a heading within this Spectrum. The Heading is returned so it can be given a title or otherwise operated upon.


getHeading

public SpectrumHeading getHeading(int min,
                                  int max)
Encapsulates a range of values in this Spectrum as a Heading. If the specified minimum or maximum is beyond the range of the Spectrum, this method may silently accept the arguments anyway. The result will be the same as if they were within the Spectrum, since no Resource can be classified with a value outside the Spectrum.


getDefinedHeadingCount

public int getDefinedHeadingCount()

getTitleTemplate

public java.lang.String getTitleTemplate()

setTitleTemplate

public void setTitleTemplate(java.lang.String template)
Sets the title template for range Headings in this Spectrum. The string "%0" is replaced with the minimum of the range, and the string "%1" is replaced with the maximum of the range.