get Chinese Leap Month - Android Internationalization

Android examples for Internationalization:Chinese

Description

get Chinese Leap Month

Demo Code


//package com.java2s;

public class Main {
    private final static byte[] lunarCalendarSpecialInfo = new byte[] {
            0x08, 0x00, 0x00, 0x05, 0x00, 0x00, 0x14, 0x00, 0x00, 0x02,
            0x00, 0x06, 0x00, 0x00, 0x15, 0x00, 0x00, 0x02, 0x00, 0x17,
            0x00, 0x00, 0x05, 0x00, 0x00, 0x14, 0x00, 0x00, 0x02, 0x00,
            0x06, 0x00, 0x00, 0x05, 0x00, 0x00, 0x13, 0x00, 0x17, 0x00,
            0x00, 0x16, 0x00, 0x00, 0x14, 0x00, 0x00, 0x02, 0x00, 0x07,
            0x00, 0x00, 0x15, 0x00, 0x00, 0x13, 0x00, 0x08, 0x00, 0x00,
            0x06, 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x07, 0x00,
            0x00, 0x05, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x16,
            0x00, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x06, 0x00, 0x00,
            0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x00, 0x00, 0x05, 0x00,
            0x00, 0x04, 0x00, 0x00, 0x02, 0x00, 0x07, 0x00, 0x00, 0x05,
            0x00, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x16, 0x00, 0x00,
            0x04, 0x00, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x05, 0x00,
            0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x16, 0x00, 0x00, 0x05,
            0x00, 0x00, 0x02, 0x00, 0x07, 0x00, 0x00, 0x15, 0x00, 0x00 };
    private final static int baseYear = 1900;

    final public static int getLeapMonth(int lunarYear) {
        return lunarCalendarSpecialInfo[lunarYear - baseYear] & 0xf;
    }//from www  . j  a v a  2s  .  c om
}

Related Tutorials