com.facetmap.simple
Class ResourceKey

java.lang.Object
  extended bycom.facetmap.simple.ResourceKey
All Implemented Interfaces:
Resource

public class ResourceKey
extends java.lang.Object
implements Resource

This class only encapsulates an integer ID, but can be treated as a Resource so that it may seamlessly be used in FacetMap retrieval operations. You would do this, for example, when Resources are stored in a database and you want to control when you fetch the data associated with the ID. The application is responsible for resolving a ResourceKey into a real Resource before trying to access its data.


Field Summary
static java.lang.String ACCESS_ERROR
           
protected  int id
           
 
Fields inherited from interface com.facetmap.Resource
LOCATION, TITLE
 
Constructor Summary
ResourceKey(int id)
           
 
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 f)
          Bind this Resource to the specified Heading.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected int id

ACCESS_ERROR

public static final java.lang.String ACCESS_ERROR
See Also:
Constant Field Values
Constructor Detail

ResourceKey

public ResourceKey(int id)
Method Detail

getId

public int getId()
Description copied from interface: Resource
Unique identifier.

Specified by:
getId in interface Resource

getHeadingCount

public int getHeadingCount()
Specified by:
getHeadingCount in interface Resource

getHeading

public Heading getHeading(int index)
Description copied from interface: Resource
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.

Specified by:
getHeading in interface Resource
Returns:
The bound Heading in the specified dimension of FacetSpace.

setHeading

public void setHeading(Heading f)
Description copied from interface: Resource
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.

Specified by:
setHeading in interface Resource

setAttribute

public void setAttribute(java.lang.Object key,
                         java.lang.String value)
Specified by:
setAttribute in interface Resource

getAttribute

public java.lang.String getAttribute(java.lang.Object key)
Specified by:
getAttribute in interface Resource