com.facetmap
Interface Map

All Known Implementing Classes:
MapAdapter

public interface Map

Represents the connections from the ResourceSpace to the FacetSpace. This is the object generally in charge of the FacetMap itself. Almost all facet operations are done within the context of some Map. The Map itself is provided by the implementation package, usually by a factory or some similar mechanism; other objects are generally created by calling methods on the Map or on another object it has created.


Method Summary
 int countAllResources(Selection sel)
          Counts all Resources in a Selection, with possible savings from doing all at once.
 void doEndMap()
          Readies the map for use.
 void doStartMap()
          Prepares the map.
 Resource[] getAllResources(Selection sel)
          this is not useful.
 boolean getAutoSelectOnlyChild()
          Return current value of autoSelectOnlyChild.
 Resource[] getDirectResources(Selection sel)
          this is not useful.
 FacetSpace getFacetSpace()
           
 java.lang.String getInfo()
          Implementation-specific string for this FacetMap class.
 ResourceSpace getResourceSpace()
           
 Selection getRootSelection()
          Produce a root Selection for the FacetSpace contained in the given facetmap.
 Selection getSelection(Heading[] headingList)
           
 Selection getSelection(java.lang.String ref)
           
 boolean getShowEmptySelections()
          Return current value of showEmptySelections.
 java.lang.String getTitle()
          A descriptive title for this FacetMap instance.
 void map(Resource resource)
          Maps every Heading in a Resource, with possible savings from doing all at once.
 void map(Resource[] resources)
          Maps every Heading in all given Resources, with possible savings from doing all at once.
 void map(Resource resource, Heading heading)
          Establishes a bond between a resource and a heading.
 void preprocess()
          Does any calculation that needs to be done before the map can be browsed.
 void setAutoSelectOnlyChild(boolean set)
          If this parameter is set true, FacetMap will avoid the situation where there's only one possible next step in any dimension, by automatically selecting that next step and presenting the options from there.
 void setShowEmptySelections(boolean set)
          If this parameter is set true, FacetMap may provide Selections with which no Resources can be reached.
 

Method Detail

getTitle

public java.lang.String getTitle()
A descriptive title for this FacetMap instance.


getInfo

public java.lang.String getInfo()
Implementation-specific string for this FacetMap class.


getFacetSpace

public FacetSpace getFacetSpace()

getResourceSpace

public ResourceSpace getResourceSpace()

preprocess

public void preprocess()
                throws InternalException,
                       DataException
Does any calculation that needs to be done before the map can be browsed. This is the place to load interim data into database, or any other task that makes it easier to serve a Selection at runtime. This method generally invokes doStartMap(), map(), and doEndMap() internally; most applications will only need to call preprocess() .

Throws:
InternalException
DataException

doStartMap

public void doStartMap()
                throws InternalException
Prepares the map.

Throws:
InternalException

map

public void map(Resource resource,
                Heading heading)
         throws DataException,
                InternalException
Establishes a bond between a resource and a heading.

Throws:
DataException
InternalException

doEndMap

public void doEndMap()
              throws InternalException
Readies the map for use. Methods on Selection should be valid once this method returns.

Throws:
InternalException

getDirectResources

public Resource[] getDirectResources(Selection sel)
                              throws DataException,
                                     InternalException
this is not useful.

Throws:
DataException
InternalException

getAllResources

public Resource[] getAllResources(Selection sel)
                           throws DataException,
                                  InternalException
this is not useful.

Throws:
DataException
InternalException

getRootSelection

public Selection getRootSelection()
                           throws InternalException
Produce a root Selection for the FacetSpace contained in the given facetmap. In other words, the Selection returned will serve as a starting point for navigation. It should have no backward selections of its own.

Throws:
InternalException

getSelection

public Selection getSelection(java.lang.String ref)
                       throws InternalException,
                              UnknownReferenceException
Throws:
InternalException
UnknownReferenceException

getSelection

public Selection getSelection(Heading[] headingList)
                       throws DataException
Throws:
DataException

map

public void map(Resource resource)
         throws DataException,
                InternalException
Maps every Heading in a Resource, with possible savings from doing all at once.

Throws:
DataException
InternalException

map

public void map(Resource[] resources)
         throws DataException,
                InternalException
Maps every Heading in all given Resources, with possible savings from doing all at once.

Throws:
DataException
InternalException

countAllResources

public int countAllResources(Selection sel)
                      throws InternalException
Counts all Resources in a Selection, with possible savings from doing all at once.

Throws:
InternalException

getAutoSelectOnlyChild

public boolean getAutoSelectOnlyChild()
Return current value of autoSelectOnlyChild.


getShowEmptySelections

public boolean getShowEmptySelections()
Return current value of showEmptySelections.


setAutoSelectOnlyChild

public void setAutoSelectOnlyChild(boolean set)
If this parameter is set true, FacetMap will avoid the situation where there's only one possible next step in any dimension, by automatically selecting that next step and presenting the options from there. See getForwardSelections for the specific mechanism.

This value is false by default.

See Also:
Selection.getForwardSelections(int)

setShowEmptySelections

public void setShowEmptySelections(boolean set)
If this parameter is set true, FacetMap may provide Selections with which no Resources can be reached. (Of course, such an empty Selection may have backward Selections which contain Resources, but its forward Selections will not). If the parameter is false, the user is guaranteed to have results in every Selection.

This value is false by default.

See Also:
Selection.getForwardSelections(int)