com.facetmap.simple
Class SimpleSpectrumFacet
java.lang.Object
com.facetmap.simple.SimpleFacet
com.facetmap.simple.SimpleSpectrumFacet
- All Implemented Interfaces:
- Facet, SpectrumFacet
public class SimpleSpectrumFacet
- extends SimpleFacet
- implements SpectrumFacet
Mutable reference implementation of SpectrumFacet.
| Nested classes/interfaces inherited from interface com.facetmap.Facet |
Facet.Util |
|
Constructor Summary |
SimpleSpectrumFacet(java.lang.String id,
java.lang.String title)
|
SimpleSpectrumFacet(java.lang.String id,
java.lang.String title,
SimpleSpectrumHeading heading)
Constructs a Spectrum that covers the range of the given
SpectrumHeading. |
SimpleSpectrumFacet(java.lang.String id,
java.lang.String title,
java.lang.String rootHeadingTitle,
int min,
int max)
Constructs a Spectrum ranging from min to
max. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
rootHeading
protected SimpleSpectrumHeading rootHeading
defaultTitleTemplate
public static java.lang.String defaultTitleTemplate
constrainRootMinimum
protected boolean constrainRootMinimum
constrainRootMaximum
protected boolean constrainRootMaximum
SimpleSpectrumFacet
public SimpleSpectrumFacet(java.lang.String id,
java.lang.String title,
java.lang.String rootHeadingTitle,
int min,
int max)
- Constructs a Spectrum ranging from
min to
max. The rootHeadingTitle argument may be left null,
in which case the root heading's title will be automatically
created from the min and max values.
SimpleSpectrumFacet
public SimpleSpectrumFacet(java.lang.String id,
java.lang.String title)
SimpleSpectrumFacet
public SimpleSpectrumFacet(java.lang.String id,
java.lang.String title,
SimpleSpectrumHeading heading)
- Constructs a Spectrum that covers the range of the given
SpectrumHeading. That heading becomes the root of the new Spectrum.
This is useful for importing a desired part of a remote Spectrum,
or for other internal purposes.
getDefinedHeadingCount
public int getDefinedHeadingCount()
- Specified by:
getDefinedHeadingCount in interface SpectrumFacet
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.
createHeadingTitle
public java.lang.String createHeadingTitle(Range range)
getSpectrumHeading
public SpectrumHeading getSpectrumHeading(java.lang.String id)
throws UnknownReferenceException
- Specified by:
getSpectrumHeading in interface SpectrumFacet
- Throws:
UnknownReferenceException
getSpectrumHeading
public SpectrumHeading getSpectrumHeading(int min,
int max)
- Description copied from interface:
SpectrumFacet
- 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.
- Specified by:
getSpectrumHeading in interface SpectrumFacet
getSpectrumHeading
public SpectrumHeading getSpectrumHeading(int value)
- Description copied from interface:
SpectrumFacet
- Get a SpectrumHeading that represents a single discrete value,
not a range. This is usually the sort of SpectrumHeading mapped
to a Resource.
- Specified by:
getSpectrumHeading in interface SpectrumFacet
getSimpleSpectrumHeading
public SimpleSpectrumHeading getSimpleSpectrumHeading(int min,
int max)
defineHeading
public SimpleSpectrumHeading defineHeading(java.lang.String id,
java.lang.String title,
int min,
int max)
getHeadingsWithin
public java.util.Vector getHeadingsWithin(Range range)
getResourceMinAndMaxHeadings
public int[] getResourceMinAndMaxHeadings(Facetmap map)
throws InternalException
- Returns two ints; first is the smallest minimum of any resource
currently in the facetmap, second is the largest maximum of any
resource currently in the facetmap. Of course, we only search
mins and maxes in the provided spectrum.
This method will return null if there are no resources in the facetmap.
- Throws:
InternalException