com.facetmap.sql
Class DateImpl

java.lang.Object
  extended by com.facetmap.simple.SimpleFacet
      extended by com.facetmap.simple.SimpleTaxonomyFacet
          extended by com.facetmap.sql.LinearFacet
              extended by com.facetmap.sql.DateImpl
All Implemented Interfaces:
DateFacet, Facet, SqlFacet, TaxonomyFacet

public class DateImpl
extends LinearFacet
implements DateFacet


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.facetmap.Facet
Facet.Util
 
Field Summary
 
Fields inherited from class com.facetmap.sql.LinearFacet
endCol, facetIndex, startCol
 
Fields inherited from class com.facetmap.simple.SimpleFacet
facetid, index, nameMap, rootHeading, title
 
Constructor Summary
DateImpl(DateFacet sourceDate)
           
DateImpl(java.lang.String id, java.lang.String title, java.lang.String rootHeadingTitle, java.util.Date startInstant, java.util.Date endInstant)
           
 
Method Summary
 void connectHeading(SimpleHeading heading)
          Rewritten for DateImpl so that auto-generated forward headings are not indexed (which would potentially take up a lot of space).
 DateHeadingImpl createAnonymousDateHeading(java.util.Date startInstant, java.util.Date endInstant)
           
 DateHeading defineHeading(java.lang.String id, java.lang.String title, java.util.Date startInstant, java.util.Date endInstant)
           
 DateHeading getDateHeading(java.util.Date instant)
          Return a DateHeading in this facet which represents only an instant.
 DateHeading getDateHeading(java.util.Date startInstant, java.util.Date endInstant)
          Return a DateHeading in this facet which represents a timespan.
 DateHeading getDateHeading(java.lang.String id)
          Return a previously defined DateHeading.
 Heading getSqlHeading(Heading sourceHeading)
          Returns the Heading from this SqlFacet that corresponds to the input sourceHeading.
 
Methods inherited from class com.facetmap.sql.LinearFacet
getHeading, getIndexedHeading, getSqlFacetSpace, getTableName, setSqlFacetSpace, sqlCreate
 
Methods inherited from class com.facetmap.simple.SimpleTaxonomyFacet
addHeading, appendHeadingInto, getHeadingCount, getSimpleTaxonomyHeading, getTaxonomyHeading, insertHeadingInto, size
 
Methods inherited from class com.facetmap.simple.SimpleFacet
containsHeading, getId, getRootHeading, getTitle, setTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.facetmap.Facet
getHeading, getId, getRootHeading, getTitle
 

Constructor Detail

DateImpl

public DateImpl(DateFacet sourceDate)

DateImpl

public DateImpl(java.lang.String id,
                java.lang.String title,
                java.lang.String rootHeadingTitle,
                java.util.Date startInstant,
                java.util.Date endInstant)
Method Detail

connectHeading

public void connectHeading(SimpleHeading heading)
Rewritten for DateImpl so that auto-generated forward headings are not indexed (which would potentially take up a lot of space). This

Overrides:
connectHeading in class SimpleFacet

defineHeading

public DateHeading defineHeading(java.lang.String id,
                                 java.lang.String title,
                                 java.util.Date startInstant,
                                 java.util.Date endInstant)
                          throws DataException
Throws:
DataException

createAnonymousDateHeading

public DateHeadingImpl createAnonymousDateHeading(java.util.Date startInstant,
                                                  java.util.Date endInstant)

getDateHeading

public DateHeading getDateHeading(java.util.Date startInstant,
                                  java.util.Date endInstant)
Description copied from interface: DateFacet
Return a DateHeading in this facet which represents a timespan. This is a low-level heading factory method that uses java.util.Date . The java.util.Date object represents an instant in time, and is therefore not really suitable for most browsing experiences, where you want to specify an interval, say, a DateHeading that represents a certain month. So it's usually easier to create common DateHeading objects with com.facetmap.simple.DateHeadingBuilder, which wraps DateFacet and provides more usable methods to get DateHeadings.

Specified by:
getDateHeading in interface DateFacet
See Also:
com.facetmap.simple.DateHeadingBuilder

getDateHeading

public DateHeading getDateHeading(java.util.Date instant)
Description copied from interface: DateFacet
Return a DateHeading in this facet which represents only an instant. The returned Heading is typically appropriate for mapping to a Resource, but usually not so useful for making a Selection.

Specified by:
getDateHeading in interface DateFacet

getDateHeading

public DateHeading getDateHeading(java.lang.String id)
                           throws UnknownReferenceException
Description copied from interface: DateFacet
Return a previously defined DateHeading.

Specified by:
getDateHeading in interface DateFacet
Throws:
UnknownReferenceException

getSqlHeading

public Heading getSqlHeading(Heading sourceHeading)
                      throws UnknownReferenceException
Description copied from interface: SqlFacet
Returns the Heading from this SqlFacet that corresponds to the input sourceHeading. This is used to rapidly translate true resource headings to SQL-based resource headings.

If no such heading exists in this SqlFacet (and if it is not correct behavior to create it), then this method returns null. This method may throw UnknownReferenceException if the sourceHeading contains references which do not resolve correctly.

Specified by:
getSqlHeading in interface SqlFacet
Overrides:
getSqlHeading in class LinearFacet
Throws:
UnknownReferenceException