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.


Field Summary
static Period[] PERIOD_ARRAY
           
static RaplaType TYPE
           
 
Fields inherited from interface org.rapla.entities.Entity
ENTITY_ARRAY
 
Method Summary
 int compareTo(Date date)
          compares the period to a date.
 int compareTo(Object object)
          compares the period to another period or a date object.
 int compareTo(Period period)
          compares the period to another period.
 boolean contains(Date date)
           
 Date getEnd()
           
 String getName()
           
 Date getStart()
           
 int getWeeks()
           
 void setEnd(Date end)
           
 void setName(String name)
           
 void setStart(Date start)
           
 String toString()
           
 int weekOf(Date date)
          returns the week of the specified date relative to the period.
 
Methods inherited from interface org.rapla.entities.Entity
isIdentical, isPersistant
 
Methods inherited from interface org.rapla.entities.RaplaObject
getRaplaType
 
Methods inherited from interface org.rapla.entities.Named
getName
 

Field Detail

TYPE

static final RaplaType TYPE

PERIOD_ARRAY

static final Period[] PERIOD_ARRAY
Method Detail

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.