com.facetmap.simple
Class DynamicFacetSpaceResource

java.lang.Object
  extended by com.facetmap.simple.SimpleResource
      extended by com.facetmap.simple.DynamicFacetSpaceResource
All Implemented Interfaces:
Resource

public class DynamicFacetSpaceResource
extends SimpleResource

A SimpleResource that can handle a changing FacetSpace. If a Facet is added, this Resource will map to that Facet's root Heading. It will correctly report all its Headings next time it's queried, and set a Heading in the new Facet when instructed.


Field Summary
protected  java.util.Vector headingVector
           
 
Fields inherited from class com.facetmap.simple.SimpleResource
attributes, facetSpace, headings, id
 
Fields inherited from interface com.facetmap.Resource
LOCATION, TITLE
 
Constructor Summary
DynamicFacetSpaceResource(FacetSpace facetSpace)
           
 
Method Summary
 Heading getHeading(int index)
          A Heading bound to this Resource.
 int getHeadingCount()
          Bind this Resource to the specified Heading.
 int getId()
          Unique identifier.
protected  void grow(int index)
           
 void setHeading(int index, Heading heading)
           
 void setId(int id)
           
 
Methods inherited from class com.facetmap.simple.SimpleResource
compoundHeading, getAttribute, setAttribute, setHeading, setHeadings, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

headingVector

protected java.util.Vector headingVector
Constructor Detail

DynamicFacetSpaceResource

public DynamicFacetSpaceResource(FacetSpace facetSpace)
Method Detail

getId

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

Specified by:
getId in interface Resource
Overrides:
getId in class SimpleResource

setId

public void setId(int id)
Overrides:
setId in class SimpleResource

grow

protected void grow(int index)

getHeading

public Heading getHeading(int index)
Description copied from interface: Resource
A Heading bound to this Resource. Because Facetmap requires that each Facet be explicitly listed in the FacetSpace, an integer index must be provided. The index corresponds to the order of the Facets in the FacetSpace.

Specified by:
getHeading in interface Resource
Overrides:
getHeading in class SimpleResource
Returns:
The bound Heading in the specified Facet.

getHeadingCount

public int getHeadingCount()
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:
getHeadingCount in interface Resource
Overrides:
getHeadingCount in class SimpleResource

setHeading

public void setHeading(int index,
                       Heading heading)
Overrides:
setHeading in class SimpleResource