org.rapla.entities.domain
Interface Period
- All Superinterfaces:
- Comparable, Entity, Named, RaplaObject
public interface Period
- extends Entity, RaplaObject, Comparable, Named
Most universities and schools are planning for fixed periods/terms
rather than arbitrary dates. Rapla provides support for this periods.
Methods inherited from interface org.rapla.entities.Named |
getName |
TYPE
static final RaplaType TYPE
PERIOD_ARRAY
static final Period[] PERIOD_ARRAY
getStart
Date getStart()
getEnd
Date getEnd()
getWeeks
int getWeeks()
getName
String getName()
setStart
void setStart(Date start)
setEnd
void setEnd(Date end)
setName
void setName(String name)
contains
boolean contains(Date date)
weekOf
int weekOf(Date date)
- returns the week of the specified date relative to the period.
- Throws:
NoSuchElementException
- if the period doesn't contain the date
toString
String toString()
- Overrides:
toString
in class Object
compareTo
int compareTo(Date date)
- compares the period to a date.
Compares endDates with date.
If dates are equal 1 will be returned:
The date is before the endDate and therefore in the period.
compareTo
int compareTo(Period period)
- compares the period to another period.
First compares startDates and if they are equal
compares endDates. If endDates are equal the hashValues, names
or some other unique value should be compared to ensure:
equals() is true <=> compareTo() returns 0;
compareTo
int compareTo(Object object)
- compares the period to another period or a date object.
- Specified by:
compareTo
in interface Comparable
- See Also:
compareTo(Date)
,
compareTo(Period)
Copyright © 2000-2006 Rapla Team. All Rights Reseserved.