com.facetmap.simple
Class SimpleDateHeading

java.lang.Object
  extended by com.facetmap.simple.SimpleHeading
      extended by com.facetmap.simple.SimpleDateHeading
All Implemented Interfaces:
DateHeading, Heading

public class SimpleDateHeading
extends SimpleHeading
implements DateHeading


Field Summary
protected  CalendarUnit calendarUnit
           
static DateTimeFormatter FORMAT_DAY
           
static DateTimeFormatter FORMAT_MONTH
           
static DateTimeFormatter FORMAT_YEAR
           
static long minuteOffset
           
protected  SimpleDateFacet simpleDateFacet
           
 
Fields inherited from class com.facetmap.simple.SimpleHeading
id, title
 
Constructor Summary
protected SimpleDateHeading(SimpleDateFacet simpleDateFacet, CalendarUnit calendarUnit)
           
protected SimpleDateHeading(SimpleDateFacet simpleDateFacet, java.lang.String id, java.lang.String title, java.util.Date startInstant, java.util.Date endInstant)
           
 
Method Summary
 java.lang.String createTitle()
           
static java.util.Date dateFromInt(int dateRepresentation)
           
 Heading getBackwardHeading()
          Zooms out to the next CalendarUnit, or the root heading, whichever is smaller.
 java.util.Date getEndInstant()
           
 Facet getFacet()
          Facet to which this Heading belongs.
 java.util.Iterator getForwardHeadings()
          See Facet for the definition of a forward heading.
 java.util.Date getStartInstant()
           
static int intFromDate(java.util.Date date)
           
 boolean matches(Heading resourceHeading)
          Matches if this date interval contains the resource heading's date interval, and the two intervals have similar scope (day, month, year, or multi-year).
 
Methods inherited from class com.facetmap.simple.SimpleHeading
getId, getTitle, isRoot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.facetmap.Heading
getId, getTitle, isRoot
 

Field Detail

FORMAT_YEAR

public static DateTimeFormatter FORMAT_YEAR

FORMAT_MONTH

public static DateTimeFormatter FORMAT_MONTH

FORMAT_DAY

public static DateTimeFormatter FORMAT_DAY

simpleDateFacet

protected SimpleDateFacet simpleDateFacet

calendarUnit

protected CalendarUnit calendarUnit

minuteOffset

public static final long minuteOffset
See Also:
Constant Field Values
Constructor Detail

SimpleDateHeading

protected SimpleDateHeading(SimpleDateFacet simpleDateFacet,
                            java.lang.String id,
                            java.lang.String title,
                            java.util.Date startInstant,
                            java.util.Date endInstant)

SimpleDateHeading

protected SimpleDateHeading(SimpleDateFacet simpleDateFacet,
                            CalendarUnit calendarUnit)
Method Detail

dateFromInt

public static java.util.Date dateFromInt(int dateRepresentation)

intFromDate

public static int intFromDate(java.util.Date date)

getEndInstant

public java.util.Date getEndInstant()
Specified by:
getEndInstant in interface DateHeading

getStartInstant

public java.util.Date getStartInstant()
Specified by:
getStartInstant in interface DateHeading

getFacet

public Facet getFacet()
Description copied from interface: Heading
Facet to which this Heading belongs. A Heading must belong to a Facet.

Specified by:
getFacet in interface Heading

getBackwardHeading

public Heading getBackwardHeading()
Zooms out to the next CalendarUnit, or the root heading, whichever is smaller. As required by Heading, returns null if this is the root heading.

Specified by:
getBackwardHeading in interface Heading

getForwardHeadings

public java.util.Iterator getForwardHeadings()
Description copied from interface: Heading
See Facet for the definition of a forward heading. This method returns an empty Iterator if the Heading has no forward headings.

Specified by:
getForwardHeadings in interface Heading

matches

public boolean matches(Heading resourceHeading)
Matches if this date interval contains the resource heading's date interval, and the two intervals have similar scope (day, month, year, or multi-year).

Overrides:
matches in class SimpleHeading

createTitle

public java.lang.String createTitle()