public class CEDate
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
int |
day
Day of the date
|
int |
month
Month of the date
|
private static long |
serialVersionUID
serialVersionUID
|
int |
year
Year of the date
|
| Constructor and Description |
|---|
CEDate()
Default constructor
|
CEDate(int month,
int day)
Constructor of CEDate class
|
CEDate(int year,
int month,
int day)
Constructor of CEDate class
|
CEDate(java.lang.String date)
Constructor of CEDate class
|
| Modifier and Type | Method and Description |
|---|---|
int |
dayOfWeek()
Return day of week of the date
|
static int |
dayOfWeek(CEDate date)
Return day of week of the date
|
static int |
dayOfWeek(int day,
int month,
int year)
Return day of week of the date
|
static int |
daysInMonth(int month,
int year)
Return number of days in the specified month
|
static java.lang.String |
getDayName(int dayOfWeek)
Return a String to represent day of week of a date
|
static java.lang.String |
getMonthDayString(int month,
int day)
Return a String to represent the month and day of week of a date
|
static int |
getMonthNumber(java.lang.String monthName)
Getter for month index (start with 1)
|
static java.lang.String |
getMonthString(int month)
Return a String to represent the month
|
boolean |
isAfter(CEDate date)
Method that checks if this CEDate is after another.
|
boolean |
isAfterOrSameAs(CEDate date)
Compare two dates
|
boolean |
isBefore(CEDate date)
Method that checks if this CEDate is before another.
|
boolean |
isBeforeOrSameAs(CEDate date)
Compare two dates
|
boolean |
isSameDateAs(CEDate date)
Method to check if two dates are the same.
|
static int[] |
numDayOfWeekInMonthAP(DemandData demandData)
Return number of days of week per month in the total year.
|
static int[] |
numDayOfWeekInMonthAP(int analysisYear,
boolean[] activeDays)
Return number of days of week in a period
|
static int[] |
numDayOfWeekInMonthAP(int analysisYear,
int startMonth,
int startDay,
int endMonth,
int endDay,
boolean[] activeDays)
Return number of days of week in a period
|
static int[] |
numEachDayOfWeekInPeriod(int year,
int month,
int startDay,
int endDay)
Returns a integer array of length 7.
|
java.lang.String |
toString() |
java.lang.String |
toWorkZoneString()
Return a String to represent the work zone
|
private static final long serialVersionUID
public int year
public int month
public int day
public CEDate()
public CEDate(int month,
int day)
month - month of the dateday - day of the datepublic CEDate(int year,
int month,
int day)
year - year of the datemonth - month of the dateday - day of the datepublic CEDate(java.lang.String date)
date - date in String (YYYY-MM-DD)public int dayOfWeek()
public static int dayOfWeek(CEDate date)
date - CEDate instancepublic static int dayOfWeek(int day,
int month,
int year)
day - day of the date (1,...,31)month - month of the date (1,...,12)year - year of the date (...,2010,2011,...)public static int daysInMonth(int month,
int year)
month - month of the dateyear - year of the datepublic static int[] numDayOfWeekInMonthAP(int analysisYear,
boolean[] activeDays)
analysisYear - year of the analysis dateactiveDays - active days in the periodpublic static int[] numDayOfWeekInMonthAP(int analysisYear,
int startMonth,
int startDay,
int endMonth,
int endDay,
boolean[] activeDays)
analysisYear - year of the analysis periodstartMonth - month of the start datestartDay - day of the start dateendMonth - month of the end dateendDay - month of the end dateactiveDays - active days in the periodpublic static int[] numDayOfWeekInMonthAP(DemandData demandData)
demandData - demand datapublic static int[] numEachDayOfWeekInPeriod(int year,
int month,
int startDay,
int endDay)
year - yearmonth - monthstartDay - start dayendDay - end daypublic boolean isBefore(CEDate date)
date - date to comparepublic boolean isAfter(CEDate date)
date - date to comparepublic boolean isSameDateAs(CEDate date)
date - date to comparepublic boolean isBeforeOrSameAs(CEDate date)
date - date to comparepublic boolean isAfterOrSameAs(CEDate date)
date - date to comparepublic static java.lang.String getMonthDayString(int month,
int day)
month - month of the dateday - day of the datepublic static java.lang.String getMonthString(int month)
month - monthpublic static int getMonthNumber(java.lang.String monthName)
monthName - month namepublic static java.lang.String getDayName(int dayOfWeek)
dayOfWeek - day of week of the datepublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toWorkZoneString()