MCPcopy Create free account
hub / github.com/6tail/lunar-java / getShenGong

Method getShenGong

src/main/java/com/nlf/calendar/EightChar.java:527–539  ·  view source on GitHub ↗

获取身宫 @return 身宫

()

Source from the content-addressed store, hash-verified

525 * @return 身宫
526 */
527 public String getShenGong() {
528 int monthZhiIndex = LunarUtil.find(getMonthZhi(), MONTH_ZHI, 0);
529 int timeZhiIndex = LunarUtil.find(getTimeZhi(), LunarUtil.ZHI, 0);
530 int offset = monthZhiIndex + timeZhiIndex;
531 if (offset > 12) {
532 offset -= 12;
533 }
534 int ganIndex = (lunar.getYearGanIndexExact() + 1) * 2 + offset;
535 while (ganIndex > 10) {
536 ganIndex -= 10;
537 }
538 return LunarUtil.GAN[ganIndex] + MONTH_ZHI[offset];
539 }
540
541 /**
542 * 获取身宫纳音

Callers 12

test17Method · 0.95
test18Method · 0.95
test21Method · 0.95
test26Method · 0.95
test27Method · 0.95
test32Method · 0.95
getShenGongNaYinMethod · 0.95
testShenGongMethod · 0.80
testShenGong1Method · 0.80
testShenGong2Method · 0.80
testShenGong3Method · 0.80
test22Method · 0.80

Calls 4

findMethod · 0.95
getMonthZhiMethod · 0.95
getTimeZhiMethod · 0.95
getYearGanIndexExactMethod · 0.80

Tested by 11

test17Method · 0.76
test18Method · 0.76
test21Method · 0.76
test26Method · 0.76
test27Method · 0.76
test32Method · 0.76
testShenGongMethod · 0.64
testShenGong1Method · 0.64
testShenGong2Method · 0.64
testShenGong3Method · 0.64
test22Method · 0.64