com.facetmap.sql
Class IndexedHeading

java.lang.Object
  extended by com.facetmap.simple.SimpleHeading
      extended by com.facetmap.simple.SimpleTaxonomyHeading
          extended by com.facetmap.sql.IndexedHeading
All Implemented Interfaces:
Heading, SqlHeading, TaxonomyHeading
Direct Known Subclasses:
DateHeadingImpl, SpectrumHeadingImpl

public class IndexedHeading
extends SimpleTaxonomyHeading
implements SqlHeading

Heading implementation for use by LinearFacet types.


Field Summary
protected static int NEEDS_SIZING
           
protected static int NO_SIZING
           
protected static int SIZED
           
protected  int sizedToResources
           
 
Fields inherited from class com.facetmap.simple.SimpleTaxonomyHeading
facet, treeNode
 
Fields inherited from class com.facetmap.simple.SimpleHeading
id, title
 
Constructor Summary
protected IndexedHeading(Heading sourceHeading)
          Creates an IndexedHeading corresponding to the source Heading, including all its descendants.
protected IndexedHeading(java.lang.String id, java.lang.String title)
           
protected IndexedHeading(java.lang.String id, java.lang.String title, Range range)
           
 
Method Summary
 LinearFacet getLinearFacet()
           
 Range getRange()
          The range represents this Heading's placement in a linear distribution of leaf Headings.
protected  void setNominalParent(IndexedHeading parent)
          Make this heading claim a parent heading, without making the parent claim this heading as a child.
 java.lang.String sqlFilterClause(java.util.Properties props)
          Return a WHERE clause (without the "WHERE" or "AND" string) that selects resources in this heading.
 void sqlMap(java.sql.Connection connection, SqlResource resource)
          Create the SQL representation of the mapping between a Resource and this Heading.
 void sqlUnmap(java.sql.Connection connection, SqlResource resource)
          Does nothing, because it stores its data in the master map table row.
 
Methods inherited from class com.facetmap.simple.SimpleTaxonomyHeading
getBackwardHeading, getBackwardHeadings, getChildCount, getFacet, getForwardHeadings, getParent, getSimpleTaxonomyFacet, getTreeNode, setSimpleTaxonomyFacet, setTreeNode, toString
 
Methods inherited from class com.facetmap.simple.SimpleHeading
getId, getTitle, isRoot, matches
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.facetmap.Heading
getId, getTitle, isRoot
 

Field Detail

NO_SIZING

protected static final int NO_SIZING
See Also:
Constant Field Values

NEEDS_SIZING

protected static final int NEEDS_SIZING
See Also:
Constant Field Values

SIZED

protected static final int SIZED
See Also:
Constant Field Values

sizedToResources

protected int sizedToResources
Constructor Detail

IndexedHeading

protected IndexedHeading(java.lang.String id,
                         java.lang.String title)

IndexedHeading

protected IndexedHeading(java.lang.String id,
                         java.lang.String title,
                         Range range)

IndexedHeading

protected IndexedHeading(Heading sourceHeading)
Creates an IndexedHeading corresponding to the source Heading, including all its descendants.

Method Detail

getRange

public Range getRange()
The range represents this Heading's placement in a linear distribution of leaf Headings. If this Heading is a leaf, the range will have length 1.


getLinearFacet

public LinearFacet getLinearFacet()

setNominalParent

protected void setNominalParent(IndexedHeading parent)
Make this heading claim a parent heading, without making the parent claim this heading as a child. This is important for anonymous headings.


sqlFilterClause

public java.lang.String sqlFilterClause(java.util.Properties props)
Description copied from interface: SqlHeading
Return a WHERE clause (without the "WHERE" or "AND" string) that selects resources in this heading. vendor argument specifies the vendor dialect of SQL to return, and can be ignored for vanilla SQL.

Method may also return null, to indicate no filtering should be done (i.e. this heading selects all resources).

Default is to filter nothing (i.e. select everything).

Specified by:
sqlFilterClause in interface SqlHeading

sqlMap

public void sqlMap(java.sql.Connection connection,
                   SqlResource resource)
            throws java.sql.SQLException
Description copied from interface: SqlHeading
Create the SQL representation of the mapping between a Resource and this Heading. REVISIT argument list.

Specified by:
sqlMap in interface SqlHeading
Throws:
java.sql.SQLException

sqlUnmap

public void sqlUnmap(java.sql.Connection connection,
                     SqlResource resource)
              throws java.sql.SQLException
Does nothing, because it stores its data in the master map table row.

Specified by:
sqlUnmap in interface SqlHeading
Throws:
java.sql.SQLException