getShenGong method
Implementation
String getShenGong() {
int monthZhiIndex = 0;
int timeZhiIndex = 0;
String monthZhi = getMonthZhi();
String timeZhi = getTimeZhi();
for (int i = 0, j = MONTH_ZHI.length; i < j; i++) {
if (monthZhi == MONTH_ZHI[i]) {
monthZhiIndex = i;
break;
}
}
for (int i = 0, j = LunarUtil.ZHI.length; i < j; i++) {
if (timeZhi == LunarUtil.ZHI[i]) {
timeZhiIndex = i;
break;
}
}
int offset = (monthZhiIndex + timeZhiIndex - 1) % 12;
return LunarUtil.GAN[((_lunar.getYearGanIndexExact() + 1) * 2 + offset) % 10 + 1] + MONTH_ZHI[offset + 1];
}