public class Date
extends mvp.Model
implements java.lang.Comparable
| Modifier and Type | Field and Description |
|---|---|
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.
|
| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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.model.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.
|
protected DayName day
protected int number
protected MonthName month
protected int year
protected boolean valid
protected java.util.Date jDate
public Date()
public Date(java.lang.String dateString)
protected void constructJCalendarIfNecessary()
protected DayName convertJavaDay(int javaDayNum)
public boolean isValid()
public boolean isEmpty()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparablepublic int hashCode()
hashCode in class java.lang.Object