com.ghasemkiani.util
Class DateFields

java.lang.Object
  extended bycom.ghasemkiani.util.DateFields

public class DateFields
extends java.lang.Object

This class holds the fields of Persian date, i.e., the Persian year, month, and day. SimplePersianCalendar uses this class to set/get the Persian date.

Version:
2.1
Author:
Ghasem Kiani

Constructor Summary
DateFields()
          Constructs a DateFields object with the date fields initialized to 0.
DateFields(int year, int month, int day)
          Constructs a DateFields object with the given date fields.
 
Method Summary
 int getDay()
          Accessor method to get the value of day.
 int getMonth()
          Accessor method to get the value of month.
 int getYear()
          Accessor method to get the value of year.
 void setDay(int day)
          Accessor method to assign a new value to day.
 void setMonth(int month)
          Accessor method to assign a new value to month.
 void setYear(int year)
          Accessor method to assign a new value to year.
 java.lang.String toString()
          This method returns a usable string representation of this object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateFields

public DateFields()
Constructs a DateFields object with the date fields initialized to 0.


DateFields

public DateFields(int year,
                  int month,
                  int day)
Constructs a DateFields object with the given date fields.

Parameters:
year - the Persian year.
month - the Persian month (zero-based).
day - the Persian day of month.
Method Detail

setYear

public void setYear(int year)
Accessor method to assign a new value to year.

Parameters:
year - The new value to be assigned to year.

getYear

public int getYear()
Accessor method to get the value of year.

Returns:
The value of year.

setMonth

public void setMonth(int month)
Accessor method to assign a new value to month.

Parameters:
month - The new value to be assigned to month.

getMonth

public int getMonth()
Accessor method to get the value of month.

Returns:
The value of month.

setDay

public void setDay(int day)
Accessor method to assign a new value to day.

Parameters:
day - The new value to be assigned to day.

getDay

public int getDay()
Accessor method to get the value of day.

Returns:
The value of day.

toString

public java.lang.String toString()
This method returns a usable string representation of this object. Month is incremented to show one-based Persian month index.

Overrides:
toString in class java.lang.Object
Returns:
a usable string representation of this object.