com.facetmap
Interface FacetSpace

All Known Implementing Classes:
SimpleFacetSpace

public interface FacetSpace

Represents the entire pandimensional space of all Facet structures. The Facets are normal to each other; in other words, there is one dimension in the FacetSpace for each facet added to it, and motion along one dimension does not cause motion along other dimensions. This allows the user to move fluidly from one Selection to another, within the FacetSpace, much like Wonka's Great Glass Elevator.

The job of a FacetSpace implementation is essentially to register and provide its various Facets, and ensure consistency between Selections. Implementations may want to cache Selections, synchronize access for dynamic facet structures, take charge of ref generation in Selections, etc.

This version of FacetMap forces a FacetSpace to have explicit dimensionality -- that is, dimensions are predefined, assigned and indexed. Future versions may allow implicit facet structures, or a more generic method of organizing facet structures.


Method Summary
 void addFacet(Facet s)
          Appends the given Taxonomy to this FacetSpace.
 Facet createFacet(java.lang.String id, java.lang.String title, Heading root)
          Creates a new Facet structure suitable for adding to this FacetSpace.
 Spectrum createSpectrum(java.lang.String id, java.lang.String title, java.lang.String rootHeadingTitle, int min, int max)
          Creates a new Spectrum facet structure suitable for adding to this FacetSpace.
 Taxonomy createTaxonomy(java.lang.String id, java.lang.String title, java.lang.String rootHeadingTitle)
          Creates a new Taxonomy facet structure suitable for adding to this FacetSpace.
 Facet getFacet(int index)
          Returns the Facet at the given index.
 Facet getFacet(java.lang.String id)
          Returns the Facet with the given identifier.
 int getFacetCount()
          Returns the number of dimensions in this FacetSpace.
 Spectrum getSpectrum(java.lang.String id)
          Returns the Spectrum with the given identifier.
 Taxonomy getTaxonomy(java.lang.String id)
          Returns the Taxonomy with the given identifier.
 java.lang.String getVersion()
          Version ID for state integrity checking.
 int indexOf(Facet f)
          Returns the index number of the dimension the Facet occupies.
 

Method Detail

getVersion

public java.lang.String getVersion()
Version ID for state integrity checking. For example, implementations may want to tag Selection refs with this number, and compare it later to see if the FacetSpace has changed.


createTaxonomy

public Taxonomy createTaxonomy(java.lang.String id,
                               java.lang.String title,
                               java.lang.String rootHeadingTitle)
                        throws DataException
Creates a new Taxonomy facet structure suitable for adding to this FacetSpace.

Throws:
DataException

createSpectrum

public Spectrum createSpectrum(java.lang.String id,
                               java.lang.String title,
                               java.lang.String rootHeadingTitle,
                               int min,
                               int max)
                        throws DataException
Creates a new Spectrum facet structure suitable for adding to this FacetSpace.

Throws:
DataException

createFacet

public Facet createFacet(java.lang.String id,
                         java.lang.String title,
                         Heading root)
                  throws DataException
Creates a new Facet structure suitable for adding to this FacetSpace. The new Facet should be of the same type as the Facet that generated the root Heading. This method is NOT typesafe and will throw an exception at runtime if the Heading is badly typed. Use with discretion.

Throws:
DataException - if the root Heading is of a type not supported by the implementation.

getFacetCount

public int getFacetCount()
Returns the number of dimensions in this FacetSpace.


getFacet

public Facet getFacet(int index)
               throws java.lang.ArrayIndexOutOfBoundsException
Returns the Facet at the given index.

Throws:
java.lang.ArrayIndexOutOfBoundsException

getFacet

public Facet getFacet(java.lang.String id)
               throws UnknownReferenceException
Returns the Facet with the given identifier.

Throws:
UnknownReferenceException

indexOf

public int indexOf(Facet f)
Returns the index number of the dimension the Facet occupies. getFacet(indexOf(f)) should return f.


getTaxonomy

public Taxonomy getTaxonomy(java.lang.String id)
                     throws UnknownReferenceException
Returns the Taxonomy with the given identifier.

Throws:
UnknownReferenceException

getSpectrum

public Spectrum getSpectrum(java.lang.String id)
                     throws UnknownReferenceException
Returns the Spectrum with the given identifier.

Throws:
UnknownReferenceException

addFacet

public void addFacet(Facet s)
Appends the given Taxonomy to this FacetSpace. Currently, structures may not be inserted into a given index position.