1
0
mirror of synced 2026-10-22 22:46:11 +08:00

add static fromXX methods

This commit is contained in:
6tail
2018-06-24 17:48:32 +08:00
parent 7741dfe979
commit c196e58ec8
7 changed files with 217 additions and 5 deletions

View File

@@ -39,7 +39,7 @@ public class SolarYear{
}
/**
* 通过年
* 通过年初始化
*
* @param year 年
*/
@@ -47,6 +47,36 @@ public class SolarYear{
this.year = year;
}
/**
* 通过指定日期获取阳历年
*
* @param date 日期
* @return 阳历年
*/
public static SolarYear fromDate(Date date){
return new SolarYear(date);
}
/**
* 通过指定日历获取阳历年
*
* @param calendar 日历
* @return 阳历年
*/
public static SolarYear fromCalendar(Calendar calendar){
return new SolarYear(calendar);
}
/**
* 通过指定年份获取阳历年
*
* @param year 年
* @return 阳历年
*/
public static SolarYear fromYear(int year){
return new SolarYear(year);
}
/**
* 获取年
*