ewe.sys
Class DateChange

java.lang.Object
  extended byewe.sys.DateChange

public class DateChange
extends Object

A DateChange object is used when calculating differences between two Dates or when adding/subtracting time periods to an existing date.


Field Summary
 int days
          The number of days difference.
 int months
          The number of months difference.
 int totalDays
          If this is used, then the years, months and days values are ignored, when passing this Object as a parameter for changing a date.
 int years
          The number of years difference.
 
Constructor Summary
DateChange()
           
 
Method Summary
 boolean isNegative()
          This is only valid when used to calculate the difference between two dates.
 DateChange set(int totalDays)
          Set the totalDays.
 DateChange set(int years, int months, int days)
          Set the years, months and days.
 String toString()
          Return a String representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode
 

Field Detail

years

public int years
The number of years difference.


months

public int months
The number of months difference.


days

public int days
The number of days difference.


totalDays

public int totalDays
If this is used, then the years, months and days values are ignored, when passing this Object as a parameter for changing a date. If this object is used to pass the return value of a difference calculation, then this value will also be valid as the total number of days that span the number of years, months and days.

Constructor Detail

DateChange

public DateChange()
Method Detail

isNegative

public boolean isNegative()
This is only valid when used to calculate the difference between two dates.

Returns:
Whether the time difference was negative.

set

public DateChange set(int years,
                      int months,
                      int days)
Set the years, months and days.

Returns:
Itself

set

public DateChange set(int totalDays)
Set the totalDays.

Returns:
Itself

toString

public String toString()
Description copied from class: Object
Return a String representation of this object.

Overrides:
toString in class Object
Returns:
a String representing this object.