com.ds.fw.types.data
Interface FwDateIF

All Superinterfaces:
java.lang.Cloneable, java.lang.Comparable, FwCopyableIF, FwDateConstantsIF, FwDisplayableIF, FwSimpleObjectIF, java.io.Serializable
All Known Implementing Classes:
FwDate

public interface FwDateIF
extends FwSimpleObjectIF, FwDateConstantsIF, java.lang.Comparable

FwDate captures a calendar day. IE, some day represented in month, day, year format. In general no checking is done to ensure that the values set are valid. For instance, setMonthDayYear(40, 500, -17) will be accepted and will set the month, day and year values exactly as specified. The method, isValid() may be called to determine if a combination is valid. Valid dates cannot be created before Jan 1, 1800. See FwDate for more details. The format for day, month, and year are as follows: day 1-31, where 1 is the first day of the month month 0-11, where 0 is January year CCYY format


Field Summary
 
Fields inherited from interface com.ds.fw.types.data.FwDateConstantsIF
DOW_FRIDAY, DOW_MONDAY, DOW_SATURDAY, DOW_SUNDAY, DOW_THURSDAY, DOW_TUESDAY, DOW_WEDNESDAY, FIRST_DAY_OF_WEEK, FIRST_YEAR, GMT_TIME_ZONE_ID, LAST_YEAR
 
Method Summary
 int _getDate()
           
 void _setDate(int i)
           
 void addDay()
          Mutate my state so that I become the next calendar date.
 void addDays(int n)
          Mutate my state so that I become n number of calendar days in the future or past.
 void addYears(int i)
          Add i years to the current date.
 void beLastDayOfMonth()
          Adjust the day value to be the last day of the month and year.
 void beToday()
          Adjust the date to be today's date.
 boolean fromString(java.lang.String s)
          Parse a string in the form of mm/dd/ccyy to set the date.
 com.ds.fw.types.data.FwDateIF getDateCopy()
           
 int getDay()
          Get the current day.
 int getDayOfWeek()
          Get the day of week index.
 java.lang.String getDayOfWeekDisplayString()
          Get a string that represents my day of week: "Sunday", "Monday", etc.
 java.util.Date getJavaDate()
          Create a new instance of a java.util.Date using the values of day, month, and year.
 int getMonth()
          Get the current month.
 com.ds.fw.types.data.FwDateIF getNextDate()
          Create a new date and set its value to be the next day after my date.
 com.ds.fw.types.data.FwDateIF getPreviousDate()
          Create a new date and set its value to be the previous date before by date.
 int getYear()
          Get the current year.
 boolean isAfter(com.ds.fw.types.data.FwDateIF d)
          Determine if my date is after d.
 boolean isBefore(com.ds.fw.types.data.FwDateIF d)
          Determine if my date is before d.
 boolean isLeapYear()
          Detemine if my year is a leap year.
 boolean isOnOrAfter(com.ds.fw.types.data.FwDateIF d)
          Determine if my date is after d.
 boolean isOnOrBefore(com.ds.fw.types.data.FwDateIF d)
          Determine if my date is before d.
 boolean isValid()
          Determine if the current values of day, month, and year are valid both independently and in combination.
 com.ds.fw.types.data.FwDateIF max(com.ds.fw.types.data.FwDateIF d)
           
 com.ds.fw.types.data.FwDateIF min(com.ds.fw.types.data.FwDateIF d)
           
 void set(int m, int d, int y)
          Set the month, day, and year values.
 void setDate(com.ds.fw.types.data.FwDateIF d)
          Set the month, day, and year.
 void setDay(int i)
          Set the current day
 void setJavaDate(java.util.Date d)
          Set the day, month and year values based on the java.util.Date.
 void setMonth(int i)
          Set the current month
 void setYear(int i)
          Set the current year
 void subtractDay()
          Mutate my state so that I become the previous calendar date.
 
Methods inherited from interface com.ds.fw.types.FwSimpleObjectIF
getClassName, getClone, getCopy, getCopy, getDeepCopy, getDisplayString, getDisplayStringFor, postCopy, toString, toStringValue
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getMonth

public int getMonth()
Get the current month.


setMonth

public void setMonth(int i)
Set the current month


getDay

public int getDay()
Get the current day.


setDay

public void setDay(int i)
Set the current day


getYear

public int getYear()
Get the current year.


setYear

public void setYear(int i)
Set the current year


setDate

public void setDate(com.ds.fw.types.data.FwDateIF d)
Set the month, day, and year.


getDayOfWeek

public int getDayOfWeek()
Get the day of week index.

See Also:
FwDateConstantsIF

addDay

public void addDay()
Mutate my state so that I become the next calendar date. Months, days and years are 'rolled' appropriately. So 12/31/1999 becomes 1/1/2000.


subtractDay

public void subtractDay()
Mutate my state so that I become the previous calendar date. Months, days and years are 'rolled' appropriately. So 1/1/2000 becomes 12/31/1999.


addDays

public void addDays(int n)
Mutate my state so that I become n number of calendar days in the future or past. If n is positive the result is equivalent to calling addDay() n times. If n is negative the result is equivalent to calling subtractDay() n times. If n is zero there is no effect.


addYears

public void addYears(int i)
Add i years to the current date. If the resultant date equal Febuary 29 on a non-lear year then change the day to be Febuary 28.


getJavaDate

public java.util.Date getJavaDate()
Create a new instance of a java.util.Date using the values of day, month, and year. This conversion uses GMT as the timezone.


setJavaDate

public void setJavaDate(java.util.Date d)
Set the day, month and year values based on the java.util.Date. This method uses GMT as the timezone.


set

public void set(int m,
                int d,
                int y)
Set the month, day, and year values. This should be equivalent to calling the three methods: setDay() setMonth() and setYear().


beLastDayOfMonth

public void beLastDayOfMonth()
Adjust the day value to be the last day of the month and year.


beToday

public void beToday()
Adjust the date to be today's date.


getNextDate

public com.ds.fw.types.data.FwDateIF getNextDate()
Create a new date and set its value to be the next day after my date. This method does not mutate my state.


getPreviousDate

public com.ds.fw.types.data.FwDateIF getPreviousDate()
Create a new date and set its value to be the previous date before by date. This method does not mutate my state.


isValid

public boolean isValid()
Determine if the current values of day, month, and year are valid both independently and in combination.


isBefore

public boolean isBefore(com.ds.fw.types.data.FwDateIF d)
Determine if my date is before d. (me < d).


isOnOrBefore

public boolean isOnOrBefore(com.ds.fw.types.data.FwDateIF d)
Determine if my date is before d. (me <= d).


isAfter

public boolean isAfter(com.ds.fw.types.data.FwDateIF d)
Determine if my date is after d. (me > d).


isOnOrAfter

public boolean isOnOrAfter(com.ds.fw.types.data.FwDateIF d)
Determine if my date is after d. (me >= d).


isLeapYear

public boolean isLeapYear()
Detemine if my year is a leap year. This is based on the the gregorian calendar rather than the julian calendar. See java.util.GregorianCalendar for more details.


getDayOfWeekDisplayString

public java.lang.String getDayOfWeekDisplayString()
Get a string that represents my day of week: "Sunday", "Monday", etc. This is a convenience method that should not be used in production. Clients should manage their own display strings.


fromString

public boolean fromString(java.lang.String s)
Parse a string in the form of mm/dd/ccyy to set the date. This is really a convenience method for testing and should not generally be used in production code. The month and day may be either one or two digits each. The year must be exactly four digits. Return true iff the date is parsed.


getDateCopy

public com.ds.fw.types.data.FwDateIF getDateCopy()

max

public com.ds.fw.types.data.FwDateIF max(com.ds.fw.types.data.FwDateIF d)

min

public com.ds.fw.types.data.FwDateIF min(com.ds.fw.types.data.FwDateIF d)

_getDate

public int _getDate()

_setDate

public void _setDate(int i)