com.facetmap.simple
Class SimpleFacetSpace

java.lang.Object
  extended by com.facetmap.simple.SimpleFacetSpace
All Implemented Interfaces:
FacetSpace
Direct Known Subclasses:
MutableSimpleFacetSpace, SqlFacetSpace

public class SimpleFacetSpace
extends java.lang.Object
implements FacetSpace

A mutable Vector-based FacetSpace. This object changes on the fly whenever the addFacet() method is used. Selection refs generated before such a change may not be valid after the change.


Field Summary
protected  java.util.Hashtable facetHash
          Indexes facets by name.
protected  java.util.Vector facets
          Indexes facets by number.
protected  int version
           
 
Constructor Summary
SimpleFacetSpace()
          Create an empty but valid SimpleFacetSpace.
 
Method Summary
 void addFacet(Facet facet)
           
 CompoundHeadingFacet getCompoundHeadingFacet(java.lang.String id)
          Returns the CompoundHeadingFacet with the given identifier.
 DateFacet getDateFacet(java.lang.String id)
          Returns the DateFacet with the given identifier.
 Facet getFacet(int index)
          Returns the Facet at the given index.
 Facet getFacet(java.lang.String id)
          Returns the Facet with the given identifier.
 int getFacetCount()
          Returns the number of Facets in this FacetSpace.
 java.util.List getFacets()
          Returns an immutable list of Facets in this FacetSpace.
 GeographyFacet getGeographyFacet(java.lang.String id)
          Returns the GeographyFacet with the given identifier.
 KeywordFacet getKeywordFacet(java.lang.String id)
          Returns the KeywordFacet with the given identifier.
 SpectrumFacet getSpectrumFacet(java.lang.String id)
          Returns the SpectrumFacet with the given identifier.
protected  TaxonomyFacet getTaxonomy(int index)
           
 TaxonomyFacet getTaxonomyFacet(java.lang.String id)
          Returns the TaxonomyFacet with the given identifier.
 java.lang.String getVersion()
          Returns zero -- version is not supported by this implementation.
 int indexOf(Facet t)
          Returns the index number of the dimension the Facet occupies.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

facets

protected java.util.Vector facets
Indexes facets by number.


facetHash

protected java.util.Hashtable facetHash
Indexes facets by name. If a taxonomy has no name, the name is its index number in the Vector.


version

protected int version
Constructor Detail

SimpleFacetSpace

public SimpleFacetSpace()
Create an empty but valid SimpleFacetSpace.

Method Detail

addFacet

public void addFacet(Facet facet)

getFacetCount

public int getFacetCount()
Description copied from interface: FacetSpace
Returns the number of Facets in this FacetSpace.

Specified by:
getFacetCount in interface FacetSpace

getFacets

public java.util.List getFacets()
Description copied from interface: FacetSpace
Returns an immutable list of Facets in this FacetSpace. This is offered in lieu of a list of facet IDs.

Specified by:
getFacets in interface FacetSpace

getFacet

public Facet getFacet(int index)
Description copied from interface: FacetSpace
Returns the Facet at the given index.

Specified by:
getFacet in interface FacetSpace

getFacet

public Facet getFacet(java.lang.String id)
               throws UnknownReferenceException
Description copied from interface: FacetSpace
Returns the Facet with the given identifier.

Specified by:
getFacet in interface FacetSpace
Throws:
UnknownReferenceException

getVersion

public java.lang.String getVersion()
Returns zero -- version is not supported by this implementation.

Specified by:
getVersion in interface FacetSpace

getTaxonomy

protected TaxonomyFacet getTaxonomy(int index)

indexOf

public int indexOf(Facet t)
Description copied from interface: FacetSpace
Returns the index number of the dimension the Facet occupies. getFacet(indexOf(F)) should return F.

Specified by:
indexOf in interface FacetSpace

getCompoundHeadingFacet

public CompoundHeadingFacet getCompoundHeadingFacet(java.lang.String id)
                                             throws UnknownReferenceException
Description copied from interface: FacetSpace
Returns the CompoundHeadingFacet with the given identifier.

Specified by:
getCompoundHeadingFacet in interface FacetSpace
Throws:
UnknownReferenceException

getDateFacet

public DateFacet getDateFacet(java.lang.String id)
                       throws UnknownReferenceException
Description copied from interface: FacetSpace
Returns the DateFacet with the given identifier.

Specified by:
getDateFacet in interface FacetSpace
Throws:
UnknownReferenceException

getGeographyFacet

public GeographyFacet getGeographyFacet(java.lang.String id)
                                 throws UnknownReferenceException
Description copied from interface: FacetSpace
Returns the GeographyFacet with the given identifier.

Specified by:
getGeographyFacet in interface FacetSpace
Throws:
UnknownReferenceException

getKeywordFacet

public KeywordFacet getKeywordFacet(java.lang.String id)
                             throws UnknownReferenceException
Description copied from interface: FacetSpace
Returns the KeywordFacet with the given identifier.

Specified by:
getKeywordFacet in interface FacetSpace
Throws:
UnknownReferenceException

getSpectrumFacet

public SpectrumFacet getSpectrumFacet(java.lang.String id)
                               throws UnknownReferenceException
Description copied from interface: FacetSpace
Returns the SpectrumFacet with the given identifier.

Specified by:
getSpectrumFacet in interface FacetSpace
Throws:
UnknownReferenceException

getTaxonomyFacet

public TaxonomyFacet getTaxonomyFacet(java.lang.String id)
                               throws UnknownReferenceException
Description copied from interface: FacetSpace
Returns the TaxonomyFacet with the given identifier.

Specified by:
getTaxonomyFacet in interface FacetSpace
Throws:
UnknownReferenceException