-
Notifications
You must be signed in to change notification settings - Fork 0
/
DateInfo.java
38 lines (29 loc) · 970 Bytes
/
DateInfo.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import java.io.Serializable;
public class DateInfo implements Serializable {
private int startMonth, endMonth, startYear;
public DateInfo(int startMonth, int startYear) {
this.startMonth = startMonth;
this.startYear = startYear;
endMonth = startMonth == 1 ? 12 : startMonth - 1;
}
public int getStartMonth() {
return startMonth;
}
public void setStartMonth(int startMonth) {
this.startMonth = startMonth;
endMonth = startMonth == 1 ? 12 : startMonth - 1;
}
public int getEndMonth() {
return endMonth;
}
public int getStartYear() {
return startYear;
}
public void setStartYear(int startYear) {
this.startYear = startYear;
}
@Override
public String toString() {
return "Start Month : " + startMonth + '\n' + "End Month : " + endMonth + '\n' + "Start Year : " + startYear + '\n';
}
}