com.facetmap
Interface Resource

All Known Implementing Classes:
ResourceKey, SimpleResource

public interface Resource

The ultimate object of desire, to put it one way. The point of FacetMap navigation is to find a Resource, so a Resource implementation can be any object that benefits from faceted classification. This interface provides a typesafe way to store and fetch string attributes of the resource -- these methods are optional and may safely return null values.


Field Summary
static java.lang.Object LOCATION
          A common attribute key to represent a path or URL for the resource.
static java.lang.Object TITLE
          A common attribute key to represent a descriptive title for the resource.
 
Method Summary
 java.lang.String getAttribute(java.lang.Object key)
           
 Heading getHeading(int index)
          A Heading bound to this Resource.
 int getHeadingCount()
           
 int getId()
          Unique identifier.
 void setAttribute(java.lang.Object key, java.lang.String value)
           
 void setHeading(Heading heading)
          Bind this Resource to the specified Heading.
 

Field Detail

LOCATION

public static final java.lang.Object LOCATION
A common attribute key to represent a path or URL for the resource.


TITLE

public static final java.lang.Object TITLE
A common attribute key to represent a descriptive title for the resource.

Method Detail

getId

public int getId()
Unique identifier.


getHeading

public Heading getHeading(int index)
A Heading bound to this Resource. Since this version of FacetMap requires explicit dimensionality of the FacetSpace, an integer index must be provided, which corresponds to the order of the Facets in the FacetSpace.

Returns:
The bound Heading in the specified dimension of FacetSpace.

setHeading

public void setHeading(Heading heading)
                throws DataException
Bind this Resource to the specified Heading. If a different Heading in the same Facet has already been bound to this Resource, that bond may be erased.

Throws:
DataException - if the specified Heading does not belong to a Facet.

getHeadingCount

public int getHeadingCount()

getAttribute

public java.lang.String getAttribute(java.lang.Object key)

setAttribute

public void setAttribute(java.lang.Object key,
                         java.lang.String value)