I need to build a backend Java class that generates Calenders. The Calendar has 12 months to complete a year. In that year, the first month is July and the last month is June. In a sense, the months in the generated calender will have a different years. For instance, the first month will be July-2016 and the last month will be June-2017 and so on. Below is what I have so far.
public class Calendars {
public Date startDate;
public Date endDate;
public String periodName;//This is the name of the year(e.g July-2016 to June-2017 may be called period01)
public short physicalYear;//This is the normal year
public Calendars() {
}
public Calendars(Date startDate, Date endDate, String periodName, short physicalYear) {
this.startDate = startDate;
this.endDate = endDate;
this.periodName = periodName;
this.physicalYear = physicalYear;
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public String getPeriodName() {
return periodName;
}
public void setPeriodName(String periodName) {
this.periodName = periodName;
}
public short getPhysicalYear() {
return physicalYear;
}
public void setPhysicalYear(short physicalYear) {
this.physicalYear = physicalYear;
}
@Override
public String toString() {
return "Calendars{" +
"startDate=" + startDate +
", endDate=" + endDate +
", periodName='" + periodName + '\'' +
", physicalYear=" + physicalYear +
'}';
}
}