com.facetmap.simple
Class SimpleResource

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

public class SimpleResource
extends java.lang.Object
implements Resource


Field Summary
static java.lang.Object ID
           
 
Fields inherited from interface com.facetmap.Resource
LOCATION, TITLE
 
Constructor Summary
SimpleResource(Map map)
           
SimpleResource(Map map, java.lang.String title)
           
SimpleResource(Map map, java.lang.String title, java.lang.String location)
           
 
Method Summary
 java.lang.String getAttribute(java.lang.Object key)
          Recognizes keys Resource.LOCATION and Resource.TITLE, as well as the string IDs of each facet in the map.
 Heading getHeading(int i)
          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.
 void setHeading(int index, Heading heading)
          these methods may disappear
 void setHeadings(Heading[] headings)
           
 void setId(int id)
          this method may disappear
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static java.lang.Object ID
Constructor Detail

SimpleResource

public SimpleResource(Map map)

SimpleResource

public SimpleResource(Map map,
                      java.lang.String title)

SimpleResource

public SimpleResource(Map map,
                      java.lang.String title,
                      java.lang.String location)
Method Detail

getId

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

Specified by:
getId in interface Resource

getAttribute

public java.lang.String getAttribute(java.lang.Object key)
Recognizes keys Resource.LOCATION and Resource.TITLE, as well as the string IDs of each facet in the map. Passing a facet ID to this function will return the title of the heading assigned in that facet, if any.

Specified by:
getAttribute in interface Resource

setAttribute

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

getHeading

public Heading getHeading(int i)
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)
                throws DataException
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
Throws:
DataException - if the specified Heading does not belong to a Facet.

getHeadingCount

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

setId

public void setId(int id)
this method may disappear


setHeading

public void setHeading(int index,
                       Heading heading)
these methods may disappear


setHeadings

public void setHeadings(Heading[] headings)

toString

public java.lang.String toString()