com.raritantechnologies.utils.time
Class DateTimePeriod

java.lang.Object
  extended bycom.raritantechnologies.utils.time.DateTimePeriod
All Implemented Interfaces:
IConfigurable

public class DateTimePeriod
extends java.lang.Object
implements IConfigurable

Represents a configurable time period, either absolute: 12/01/1997 to 12/01/2003 or relative: "last 2 months" or "2 to 4 months ago".

XML Configuration Template:
   <DateTimePeriod 
       period="[ parsable time period string e.g. '4 to 7 days ago']" />

   <DateTimePeriod 
       dateFormat="[ date format e.g. 'MM/dd/yyyy' ]"
       from="[ from date ]"
       to="[ to date ]" />
 

Developed by Raritan Technologies .

Author:
Ted Sullivan

Constructor Summary
DateTimePeriod()
           
DateTimePeriod(java.util.Date from, java.util.Date to)
           
DateTimePeriod(java.util.Date from, java.util.Date to, java.lang.Object dated)
           
DateTimePeriod(java.lang.String periodSt)
           
DateTimePeriod(java.lang.String fromSt, java.lang.String toSt)
           
 
Method Summary
 boolean contains(java.util.Date aDate)
           
 java.lang.Object getDatedObject()
           
 java.util.Date getFrom()
           
 java.lang.String getTimePeriod()
           
 java.util.Date getTo()
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 void resetTimePeriods()
           
 void setAllTimePeriods()
           
 void setDatedObject(java.lang.Object datedOb)
           
 void setFrom(java.util.Date from)
           
 void setTimePeriods(java.lang.String perSt)
           
 void setTo(java.util.Date to)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateTimePeriod

public DateTimePeriod()

DateTimePeriod

public DateTimePeriod(java.util.Date from,
                      java.util.Date to)

DateTimePeriod

public DateTimePeriod(java.util.Date from,
                      java.util.Date to,
                      java.lang.Object dated)

DateTimePeriod

public DateTimePeriod(java.lang.String fromSt,
                      java.lang.String toSt)

DateTimePeriod

public DateTimePeriod(java.lang.String periodSt)
Method Detail

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IConfigurable
Initializes the object from an XML tag or element. This method is called by the Framework as part of the application initializtion. see ConfigurationManager, XMLConfigurationManager, XMLSearchFieldMapFactory, XMLSearchSourceFactory. Configurable objects that are owned or contained by other configurable objects will be initialized in by the parent object.

Specified by:
initialize in interface IConfigurable

getTimePeriod

public java.lang.String getTimePeriod()

resetTimePeriods

public void resetTimePeriods()

setTimePeriods

public void setTimePeriods(java.lang.String perSt)

setAllTimePeriods

public void setAllTimePeriods()

setFrom

public void setFrom(java.util.Date from)

getFrom

public java.util.Date getFrom()

setTo

public void setTo(java.util.Date to)

getTo

public java.util.Date getTo()

contains

public boolean contains(java.util.Date aDate)

setDatedObject

public void setDatedObject(java.lang.Object datedOb)

getDatedObject

public java.lang.Object getDatedObject()