Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
de.webdings.tools.time.EasyDate
public class EasyDate
extends java.lang.Object
java.util.Calendar
and its subclasses to provide easy date-representing
functionality.
By default it wraps a java.util.GregorianCalendar
java.util.Calendar
, java.util.GregorianCalendar
, EasyDateCreateException
Constructor Summary | |
| |
| |
|
public EasyDate()
constructs an EasyDate object wrapping ajava.util.GregorianCalendar
initialized at the moment of this constructor's call. Essentially, an object constructed by this constructor represents today.
public EasyDate(Calendar cal)
constructs an EasyDate object wrapping the specified calendar.
- Parameters:
cal
- The calendar to be wrapped. The constructor accepts any subclass ofjava.util.Calendar
public EasyDate(int year, int month, int day) throws EasyDateCreateException
constructs an EasyDate object wrapping ajava.util.GregorianCalendar
of the specified year, month and day. IMPORTANT: note that unlike injava.util.GregorianCalendar
's constructors January is represented by 1 and not by 0! So the months are represented according to the following table:
int # represented month 1 January 2 February 3 March 4 April 5 May 6 June 7 July 8 August 9 September 10 October 11 November 12 December
- Parameters:
year
- the yearmonth
- the monthday
- the day
- Throws:
EasyDateCreateException
- when an invalid month value is specified
public Calendar getCal()
- Returns:
- the wrapped calendar.
public int getDay()
- Returns:
- the
java.util.Calendar.DAY_OF_MONTH
field of the wrapped calendar
public int getMonth()
- Returns:
- the
java.util.Calendar.MONTH
field of the wrapped calendar
public int getYear()
- Returns:
- the
java.util.Calendar.YEAR
field of the wrapped calendar
public void setCal(Calendar cal)
- Parameters:
cal
- The calender to be wrapped.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU
General Public License along with this program;
if not, write to the
Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.