cynosurex.util
Class EnhancedDate

java.lang.Object
  extended by java.util.Date
      extended by cynosurex.util.EnhancedDate
All Implemented Interfaces:
cynosurex.internal.AuthorCommon, cynosurex.internal.CommonInterface, cynosurex.internal.CompanyCommon, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<java.util.Date>

public class EnhancedDate
extends java.util.Date
implements cynosurex.internal.CommonInterface

EnhancedDate extends the Java Date class. It added the ability to return day as a string and the ability to return the Julian day as a integer.

See Also:
Serialized Form

Field Summary
protected  java.util.Calendar calendar
           
protected static int[] leapYearDays
           
protected static int[] nonLeapYearDays
           
protected  java.util.TimeZone tz
           
 
Fields inherited from interface cynosurex.internal.CommonInterface
copyright, copyrightYears, notice, program, version
 
Fields inherited from interface cynosurex.internal.AuthorCommon
author, copyrightSymbol, noticeMsg, rights
 
Fields inherited from interface cynosurex.internal.CompanyCommon
company, email, website
 
Constructor Summary
EnhancedDate()
          Constructor to create an EnhancedDate object from the current system date and time.
EnhancedDate(int year, int julianDay)
          Constructor to create an EnhancedDate object from a year and a Julian day integer.
EnhancedDate(long date)
          Constructor to create an EnhancedDate object from a long integer.
 
Method Summary
 java.lang.String getDayString()
          Method to return the Day field in String.
 int getJulianDay()
          Method to return the Julian day in String.
 java.lang.String getMonthString()
          Method to return the Month field in String.
 java.lang.String getShortDayString()
          Method to return the Day field in String, in three-character form.
 java.lang.String getShortMonthString()
          Method to return the Month field in String, in three-character form.
static boolean isDateString(java.lang.CharSequence date)
          This method checks the passed-in string to see if it is formatted as a valid date string.
 boolean isLeapYear()
          Method to determine if the year contained within this Date object is a leap year.
static boolean isLeapYear(int year)
          Static method which determines if the year specified is a leap year.
static int monthStringToInt(java.lang.String month)
          Static method to convert month String to int.
static java.lang.String monthStringToIntString(java.lang.String month)
          Static method to convert month String to int String.
 java.lang.String to_RFC822_String()
          Returns the current date and time in the RFC 822 string format.
 java.lang.String to_RSS_String()
          Returns the current date and time in a string format that is compatible with RSS feed.
 java.lang.String toShortDayString()
          Deprecated.  
 
Methods inherited from class java.util.Date
after, before, clone, compareTo, equals, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, hashCode, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setTime, setYear, toGMTString, toLocaleString, toString, UTC
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

leapYearDays

protected static int[] leapYearDays

nonLeapYearDays

protected static int[] nonLeapYearDays

tz

protected java.util.TimeZone tz

calendar

protected java.util.Calendar calendar
Constructor Detail

EnhancedDate

public EnhancedDate()
Constructor to create an EnhancedDate object from the current system date and time.


EnhancedDate

public EnhancedDate(long date)
Constructor to create an EnhancedDate object from a long integer.


EnhancedDate

public EnhancedDate(int year,
                    int julianDay)
Constructor to create an EnhancedDate object from a year and a Julian day integer.

Method Detail

getDayString

public java.lang.String getDayString()
Method to return the Day field in String. For example, Monday, Wednesday, Sunday, etc.


getJulianDay

public int getJulianDay()
Method to return the Julian day in String.


getMonthString

public java.lang.String getMonthString()
Method to return the Month field in String. For example, January, February, March, etc.


getShortDayString

public java.lang.String getShortDayString()
Method to return the Day field in String, in three-character form. For example, Mon, Wed, Sun, etc.


getShortMonthString

public java.lang.String getShortMonthString()
Method to return the Month field in String, in three-character form. For example, Jan, Feb, Mar, etc.


isDateString

public static boolean isDateString(java.lang.CharSequence date)
This method checks the passed-in string to see if it is formatted as a valid date string. This Java method is very similar to the Virtual Basic isDate function.


isLeapYear

public boolean isLeapYear()
Method to determine if the year contained within this Date object is a leap year.


isLeapYear

public static boolean isLeapYear(int year)
Static method which determines if the year specified is a leap year.


monthStringToInt

public static int monthStringToInt(java.lang.String month)
                            throws InvalidMonthStringException
Static method to convert month String to int. For example: "Jan" -> 1 or "January" -> 1

Throws:
InvalidMonthStringException

monthStringToIntString

public static java.lang.String monthStringToIntString(java.lang.String month)
                                               throws InvalidMonthStringException
Static method to convert month String to int String. For example: "Jan" -> "01" or "January" -> "01"

Throws:
InvalidMonthStringException

to_RFC822_String

public java.lang.String to_RFC822_String()
Returns the current date and time in the RFC 822 string format.


to_RSS_String

public java.lang.String to_RSS_String()
Returns the current date and time in a string format that is compatible with RSS feed.


toShortDayString

public java.lang.String toShortDayString()
Deprecated. 

Method to return the Day field in String, in three-character form. For example, Mon, Wed, Sun, etc. The semantics of this method is incorrect. It has been replaced with "getShortDayString ()". This method is deprecated and its functionality will be replaced with another functionality.