|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
mvp.Model
caltool.schedule.Date
public class Date
Class Date is the basic unit of calendar time keeping, consisting of a day of the week, numeric date, month, and year.
Field Summary | |
---|---|
protected DayName |
day
One of the seven standard days of the week |
protected java.util.Date |
jDate
The java.util.Date value that represents this' date. |
protected MonthName |
month
One of the twelve months of the year |
protected int |
number
Numeric date in a month, between 1 and 31 |
protected boolean |
valid
True if this is a valud date |
protected int |
year
The four-digit year number. |
Fields inherited from class mvp.Model |
---|
view |
Constructor Summary | |
---|---|
Date()
Construct an empty Date. |
|
Date(DayName day,
int number,
MonthName month,
int year)
Construct a date from the given field values. |
|
Date(java.lang.String dateString)
Construct a date from the given string. |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object o)
Define compareTo using java.util.Calendar. |
protected void |
constructJCalendarIfNecessary()
Construct the static java.util.format and Calendar if this is the first time the constructor has been called. |
protected DayName |
convertJavaDay(int javaDayNum)
Convert a java.util.Calendar.DAY_OF_WEEK number to a caltool.schedule.DayName enum. |
boolean |
equals(java.lang.Object obj)
Define equality for this as componentwise equality. |
int |
hashCode()
Define the hash code for this as the sum of the components. |
boolean |
isEmpty()
Return true if this is an empty date, indicated by the date number = 0. |
boolean |
isValid()
Return true if this is a valid date. |
java.lang.String |
toString()
Return the string representation of this. |
Methods inherited from class mvp.Model |
---|
dump, exit, getView, setView |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected DayName day
protected int number
protected MonthName month
protected int year
protected boolean valid
protected java.util.Date jDate
Constructor Detail |
---|
public Date()
public Date(java.lang.String dateString)
public Date(DayName day, int number, MonthName month, int year)
Method Detail |
---|
protected void constructJCalendarIfNecessary()
protected DayName convertJavaDay(int javaDayNum)
public boolean isValid()
public boolean isEmpty()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |