Package net.hebrewcalendar.impl
Class DateImpl<C extends ICalendar<C>>
- java.lang.Object
-
- net.hebrewcalendar.impl.DateImpl<C>
-
- All Implemented Interfaces:
Comparable<IDate<?>>,IDate<C>
public class DateImpl<C extends ICalendar<C>> extends Object implements IDate<C>
Concrete implementation ofIDate. Instances are created byAbstractCalendar.fromYMD(int, int, int)and conversion methods; not intended for direct construction.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longabsDay()DateImpl<C>addDays(int numDays)Increment by given number of daysbooleanafter(IDate<?> otherDate)Compare dates and return true if thisIDateis strictly after the arg onebooleanbefore(IDate<?> otherDate)Compare dates and return true if thisIDateis strictly before the arg oneintcompareTo(IDate<?> o)booleanequals(Object o)CgetCalendar()CalendarTypegetCalendarType()intgetDay()intgetDayOfWeek()1 - Sunday ..intgetMonth()intgetYear()DateImpl<C>subtractDays(int numDays)Decrement by given number of daysStringtoString()
-
-
-
Method Detail
-
getYear
public final int getYear()
-
getMonth
public final int getMonth()
-
getDay
public final int getDay()
-
getCalendar
public final C getCalendar()
- Specified by:
getCalendarin interfaceIDate<C extends ICalendar<C>>- Returns:
- the calendar for which this date was created.
-
before
public final boolean before(IDate<?> otherDate)
Description copied from interface:IDateCompare dates and return true if thisIDateis strictly before the arg one
-
after
public final boolean after(IDate<?> otherDate)
Description copied from interface:IDateCompare dates and return true if thisIDateis strictly after the arg one
-
getCalendarType
public final CalendarType getCalendarType()
- Specified by:
getCalendarTypein interfaceIDate<C extends ICalendar<C>>- Returns:
- the
CalendarTypefor which this date was created.
-
absDay
public long absDay()
-
addDays
public final DateImpl<C> addDays(int numDays)
Description copied from interface:IDateIncrement by given number of days
-
subtractDays
public final DateImpl<C> subtractDays(int numDays)
Description copied from interface:IDateDecrement by given number of days- Specified by:
subtractDaysin interfaceIDate<C extends ICalendar<C>>- Parameters:
numDays- days to subtract- Returns:
- new date object
-
getDayOfWeek
public final int getDayOfWeek()
1 - Sunday .. 7 - Saturday- Specified by:
getDayOfWeekin interfaceIDate<C extends ICalendar<C>>- Returns:
- day of week 1-7
-
-