|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hackystat.utilities.time.period.Week
public class Week
Provides a representation for seven Day instances where the first Day is always a Sunday and the last Day is always the following Saturday.
The Calendar is forced to Locale.US to ensure constant week boundaries.
Constructor Summary | |
---|---|
Week()
Create a Week instance that starts on Sunday and ends on Saturday and that includes today. |
|
Week(java.util.Date date)
Create a Week instance that includes the passed date. |
|
Week(Day day)
Creates a Week instance that starts on Sunday and ends on Saturday and that includes the passed day. |
|
Week(javax.xml.datatype.XMLGregorianCalendar xmlDay)
Creates a week instance starting on Sunday and ending on Saturday that includes the passed Day. |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object obj)
Compares two Week objects. |
Week |
dec()
Returns a new Week instance representing the previous Week. |
boolean |
equals(java.lang.Object obj)
Returns true if the passed object is a Week and is equal to this Week. |
java.util.List<Day> |
getDays()
Returns a list with the seven Day instances in this Week. |
Day |
getFirstDay()
Gets first day of this Week, always a Sunday. |
Day |
getLastDay()
Gets the last day of this Week, always a Saturday. |
java.lang.String |
getWeekRepresentation()
Returns a String representation of this Week. |
int |
hashCode()
Calculate the hashcode for this Week. |
Week |
inc()
Returns a new Week instance representing the next Week. |
java.lang.String |
toString()
First day of the week is chosen to represent the week in toString(). |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Week()
public Week(java.util.Date date)
date
- The date to be included in the constructed Week.public Week(Day day)
day
- A day that identifies the Week to be returned.public Week(javax.xml.datatype.XMLGregorianCalendar xmlDay)
xmlDay
- The day.Method Detail |
---|
public Day getFirstDay()
getFirstDay
in interface TimePeriod
public Day getLastDay()
public java.util.List<Day> getDays()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- Any object.
public java.lang.String getWeekRepresentation()
public java.lang.String toString()
toString
in class java.lang.Object
public Week dec()
public Week inc()
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable<java.lang.Object>
obj
- Another week object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |