com.raritantechnologies.utils.time
Class DateTime

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

public class DateTime
extends java.lang.Object
implements IConfigurable

Wraps a java.util.Date and precise time: hours minutes seconds.


Developed by Raritan Technologies .

Author:
Ted Sullivan

Field Summary
static long DAY_LEN
           
static long HOUR_LEN
           
 
Constructor Summary
DateTime()
           
DateTime(java.util.Date date)
           
DateTime(int year, int month, int date)
           
DateTime(int year, int month, int date, int hour, int minute)
           
DateTime(int year, int month, int date, int hour, int minute, int second)
           
 
Method Summary
 boolean after(DateTime another)
           
 boolean before(DateTime another)
           
static int daysBetween(java.util.Date second, java.util.Date first)
           
static int daysBetween(DateTime second, DateTime first)
           
 void decrementBy(int hours, int minutes, int seconds)
           
 boolean equals(DateTime another)
           
static java.util.Date getCleanDate(java.util.Date date)
           
 java.util.Date getDate()
           
 int getDays()
           
 int getHours()
           
 int getMinutes()
           
 int getSeconds()
           
 long getTime()
           
 void incrementBy(int hours, int minutes, int seconds)
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 void setDate(java.util.Date date)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HOUR_LEN

public static long HOUR_LEN

DAY_LEN

public static long DAY_LEN
Constructor Detail

DateTime

public DateTime()

DateTime

public DateTime(java.util.Date date)

DateTime

public DateTime(int year,
                int month,
                int date)

DateTime

public DateTime(int year,
                int month,
                int date,
                int hour,
                int minute)

DateTime

public DateTime(int year,
                int month,
                int date,
                int hour,
                int minute,
                int second)
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

getDate

public java.util.Date getDate()

setDate

public void setDate(java.util.Date date)

getTime

public long getTime()

incrementBy

public void incrementBy(int hours,
                        int minutes,
                        int seconds)

decrementBy

public void decrementBy(int hours,
                        int minutes,
                        int seconds)

after

public boolean after(DateTime another)

before

public boolean before(DateTime another)

equals

public boolean equals(DateTime another)

toString

public java.lang.String toString()

getDays

public int getDays()

getHours

public int getHours()

getMinutes

public int getMinutes()

getSeconds

public int getSeconds()

getCleanDate

public static java.util.Date getCleanDate(java.util.Date date)

daysBetween

public static int daysBetween(DateTime second,
                              DateTime first)

daysBetween

public static int daysBetween(java.util.Date second,
                              java.util.Date first)