From 0ac183d56bf629bd4f9c17e61efbca5acc328b53 Mon Sep 17 00:00:00 2001 From: Magic Len Date: Sat, 12 Mar 2016 15:15:40 +0800 Subject: [PATCH] Release 2.1.1 --- JavaChineseCalendar.jar | Bin 0 -> 14546 bytes README.md | 83 ++ javadoc/allclasses-frame.html | 26 + javadoc/allclasses-noframe.html | 26 + javadoc/constant-values.html | 166 +++ javadoc/deprecated-list.html | 123 ++ javadoc/help-doc.html | 224 ++++ javadoc/index-files/index-1.html | 130 ++ javadoc/index-files/index-10.html | 130 ++ javadoc/index-files/index-11.html | 131 ++ javadoc/index-files/index-12.html | 130 ++ javadoc/index-files/index-13.html | 166 +++ javadoc/index-files/index-14.html | 142 ++ javadoc/index-files/index-15.html | 176 +++ javadoc/index-files/index-2.html | 130 ++ javadoc/index-files/index-3.html | 130 ++ javadoc/index-files/index-4.html | 143 ++ javadoc/index-files/index-5.html | 128 ++ javadoc/index-files/index-6.html | 131 ++ javadoc/index-files/index-7.html | 171 +++ javadoc/index-files/index-8.html | 170 +++ javadoc/index-files/index-9.html | 136 ++ javadoc/index.html | 72 + .../class-use/\347\211\210\346\234\254.html" | 123 ++ .../class-use/\350\276\262\346\233\206.html" | 186 +++ ...346\233\206.\345\234\260\346\224\257.html" | 205 +++ ...346\233\206.\345\244\251\345\271\262.html" | 185 +++ ...350\276\262\346\233\206.\346\227\245.html" | 192 +++ ...350\276\262\346\233\206.\346\234\210.html" | 206 +++ ...346\233\206.\347\224\237\350\202\226.html" | 163 +++ .../package-frame.html" | 30 + .../package-summary.html" | 191 +++ .../package-tree.html" | 149 +++ .../package-use.html" | 169 +++ .../\347\211\210\346\234\254.html" | 327 +++++ .../\350\276\262\346\233\206.html" | 1167 +++++++++++++++++ ...346\233\206.\345\234\260\346\224\257.html" | 465 +++++++ ...346\233\206.\345\244\251\345\271\262.html" | 441 +++++++ ...350\276\262\346\233\206.\346\227\245.html" | 681 ++++++++++ ...350\276\262\346\233\206.\346\234\210.html" | 465 +++++++ ...346\233\206.\347\224\237\350\202\226.html" | 465 +++++++ javadoc/overview-tree.html | 153 +++ javadoc/package-list | 1 + javadoc/script.js | 30 + javadoc/stylesheet.css | 574 ++++++++ .../\347\211\210\346\234\254.java" | 55 + .../\350\276\262\346\233\206.java" | 921 +++++++++++++ 47 files changed, 10408 insertions(+) create mode 100644 JavaChineseCalendar.jar create mode 100644 README.md create mode 100644 javadoc/allclasses-frame.html create mode 100644 javadoc/allclasses-noframe.html create mode 100644 javadoc/constant-values.html create mode 100644 javadoc/deprecated-list.html create mode 100644 javadoc/help-doc.html create mode 100644 javadoc/index-files/index-1.html create mode 100644 javadoc/index-files/index-10.html create mode 100644 javadoc/index-files/index-11.html create mode 100644 javadoc/index-files/index-12.html create mode 100644 javadoc/index-files/index-13.html create mode 100644 javadoc/index-files/index-14.html create mode 100644 javadoc/index-files/index-15.html create mode 100644 javadoc/index-files/index-2.html create mode 100644 javadoc/index-files/index-3.html create mode 100644 javadoc/index-files/index-4.html create mode 100644 javadoc/index-files/index-5.html create mode 100644 javadoc/index-files/index-6.html create mode 100644 javadoc/index-files/index-7.html create mode 100644 javadoc/index-files/index-8.html create mode 100644 javadoc/index-files/index-9.html create mode 100644 javadoc/index.html create mode 100644 "javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\347\211\210\346\234\254.html" create mode 100644 "javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.html" create mode 100644 "javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.\345\234\260\346\224\257.html" create mode 100644 "javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.\345\244\251\345\271\262.html" create mode 100644 "javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.\346\227\245.html" create mode 100644 "javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.\346\234\210.html" create mode 100644 "javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.\347\224\237\350\202\226.html" create mode 100644 "javadoc/org/magiclen/\350\276\262\346\233\206/package-frame.html" create mode 100644 "javadoc/org/magiclen/\350\276\262\346\233\206/package-summary.html" create mode 100644 "javadoc/org/magiclen/\350\276\262\346\233\206/package-tree.html" create mode 100644 "javadoc/org/magiclen/\350\276\262\346\233\206/package-use.html" create mode 100644 "javadoc/org/magiclen/\350\276\262\346\233\206/\347\211\210\346\234\254.html" create mode 100644 "javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.html" create mode 100644 "javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.\345\234\260\346\224\257.html" create mode 100644 "javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.\345\244\251\345\271\262.html" create mode 100644 "javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.\346\227\245.html" create mode 100644 "javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.\346\234\210.html" create mode 100644 "javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.\347\224\237\350\202\226.html" create mode 100644 javadoc/overview-tree.html create mode 100644 javadoc/package-list create mode 100644 javadoc/script.js create mode 100644 javadoc/stylesheet.css create mode 100644 "src/org/magiclen/\350\276\262\346\233\206/\347\211\210\346\234\254.java" create mode 100644 "src/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.java" diff --git a/JavaChineseCalendar.jar b/JavaChineseCalendar.jar new file mode 100644 index 0000000000000000000000000000000000000000..248e879c1357daa702aebdb8ceaa2a2dfbaf56d1 GIT binary patch literal 14546 zcma*O1y~$g@;;2aySux)yL)hVcemi~?j9V12M;#5LkRBf4k5?~d-u0{?|pXn|J6MG zOwV-H+oyY~&Z+9DS4kEW3m*uN~GfIdz?yT{0__^zq_ zzM;Lp{xwp0VFhUkaaA=2c?n=3q< zu=@}q}tEPxX!CnJ(N9Cg-^q-@6GwJR?>R;B>1EX9me}Wf2&5 zqJqtI$u)5&Fwf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vu(&4qfJZu=#qyCe(yU+SY)F3 zXc}Y6o;L8Eki~e0<~QEI)dw+##23zbA@ZF@22wbXp5AmLFpAAjgX+ZW=hHbG@lJpL z%w>c-Afl>|ciQ7b8Q0Oz_Q_uI^znK1$ z$@Fi8|3u09KLjA4lEBLM5C6K-KM}P4j__Ch)SnRq-`P?BX$*g6Q~eq3gH-lc_RXKs z6yMu@{uA1N;Ntup^sjt^KZDM`H}(B5&_A&Y{to)ruIfL762Cjr{{a10kM-XX|Js@O zXGBKC|Bd*6eTsia{A-uhpAnl;{wLy}d#?Tt`q#FRKZ9~({4dZynn;vn!T-@n2?qoR NWb^)$Dzkqe{C^DsXX*d| literal 0 HcmV?d00001 diff --git a/README.md b/README.md new file mode 100644 index 0000000..a187ce9 --- /dev/null +++ b/README.md @@ -0,0 +1,83 @@ +Java Chinese Calendar +================================= + +# Introduction + +**Java Chinese Calendar** is a Java library of Chinese (lunar) calendar. It can convert date between Gregorian calendar(also called Western calendar) and Chinese calendar. Also, it can compute the weight of Ba Zi(八字). + +# Usage + +A large part of the code about **Java Chinese Calendar** is written in Chinese. + +## 農曆 Class + +**農曆** class is in the *org.magiclen.農曆* package. + +### Initialize + +You can't create a **農曆** instance by using **new** operator directly. You have to use the **建立** static method provided by **農曆** class to create a **農曆** instance. + +You can pass the year, month and the days of the month in Gregorian calendar as parameters to **建立** method. + +For example, we want to create a **農曆** object instance with the date 2015-12-16 in Gregorian calendar. The code will be, + + 農曆.建立(2015, 12, 12); + +For example, we want to create a **農曆** object instance with the date 2015-12-16 in Chinese calendar and we know that date is not in a leap month. The code will be, + + 農曆 date = 農曆.建立(2015, 12, false, 12); + +### Get the date in Gregorian calendar + +Use **取得西曆** method to get the date in Gregorian calendar. + + String gregorianDate = date.取得西曆(); + +### Get the date in Chinese calendar + +Use **取得農曆** method to get the date in Chinese calendar. + + String chineseDate = date.取得農曆(); + +### Compute the weight of Ba Zi(八字) + +Use **計算八字有幾兩重** method to compute the weight of Ba Zi. Because **農曆** object has no hour information, if you want to compute the weight of Ba Zi, you have to provide the hour information in the form of the twelve Earthly Branches. + + float BaZiWeight = date.計算八字有幾兩重(農曆.地支.子); + +# Run **Java Chinese Calendar** as a program + +You can also use the two commands below to run **Java Chinese Calendar**: + + java -jar JavaChineseCalendar.jar + +It will show today's date in Gregorian calendar and Chinese calendar. The result just likes + + 西曆:2015-12-16 + 農曆:2015(乙未、羊年) 冬月 初六 + +You can input a date in Gregorian calendar. This program can convert it to the date in Chinese calendar. + + java -jar JavaChineseCalendar.jar YYYY MM DD + +# License + + Copyright 2015-2016 magiclen.org + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +# What's More? + +Please check out our web page at + +https://magiclen.org/java-chinese-calendar/ diff --git a/javadoc/allclasses-frame.html b/javadoc/allclasses-frame.html new file mode 100644 index 0000000..1e7b564 --- /dev/null +++ b/javadoc/allclasses-frame.html @@ -0,0 +1,26 @@ + + + + + + +All Classes + + + + + +

All Classes

+ + + diff --git a/javadoc/allclasses-noframe.html b/javadoc/allclasses-noframe.html new file mode 100644 index 0000000..f4dfe89 --- /dev/null +++ b/javadoc/allclasses-noframe.html @@ -0,0 +1,26 @@ + + + + + + +All Classes + + + + + +

All Classes

+ + + diff --git a/javadoc/constant-values.html b/javadoc/constant-values.html new file mode 100644 index 0000000..207e5a5 --- /dev/null +++ b/javadoc/constant-values.html @@ -0,0 +1,166 @@ + + + + + + +Constant Field Values + + + + + + + + + + + +
+

Constant Field Values

+

Contents

+ +
+
+ + +

org.magiclen.*

+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + +
    org.magiclen.農曆.版本 
    Modifier and TypeConstant FieldValue
    + +public static final intMAINTENANCE1
    + +public static final intMAJOR2
    + +public static final intMINOR1
    +
  • +
+
+ + + + + + diff --git a/javadoc/deprecated-list.html b/javadoc/deprecated-list.html new file mode 100644 index 0000000..b1ff7a2 --- /dev/null +++ b/javadoc/deprecated-list.html @@ -0,0 +1,123 @@ + + + + + + +Deprecated List + + + + + + + + +
+ + + + + + + +
+ + +
+

Deprecated API

+

Contents

+
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/help-doc.html b/javadoc/help-doc.html new file mode 100644 index 0000000..4b4080a --- /dev/null +++ b/javadoc/help-doc.html @@ -0,0 +1,224 @@ + + + + + + +API Help + + + + + + + + + + + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
    +
  • +

    Package

    +

    Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:

    +
      +
    • Interfaces (italic)
    • +
    • Classes
    • +
    • Enums
    • +
    • Exceptions
    • +
    • Errors
    • +
    • Annotation Types
    • +
    +
  • +
  • +

    Class/Interface

    +

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
      +
    • Class inheritance diagram
    • +
    • Direct Subclasses
    • +
    • All Known Subinterfaces
    • +
    • All Known Implementing Classes
    • +
    • Class/interface declaration
    • +
    • Class/interface description
    • +
    +
      +
    • Nested Class Summary
    • +
    • Field Summary
    • +
    • Constructor Summary
    • +
    • Method Summary
    • +
    +
      +
    • Field Detail
    • +
    • Constructor Detail
    • +
    • Method Detail
    • +
    +

    Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

    +
  • +
  • +

    Annotation Type

    +

    Each annotation type has its own separate page with the following sections:

    +
      +
    • Annotation Type declaration
    • +
    • Annotation Type description
    • +
    • Required Element Summary
    • +
    • Optional Element Summary
    • +
    • Element Detail
    • +
    +
  • +
  • +

    Enum

    +

    Each enum has its own separate page with the following sections:

    +
      +
    • Enum declaration
    • +
    • Enum description
    • +
    • Enum Constant Summary
    • +
    • Enum Constant Detail
    • +
    +
  • +
  • +

    Use

    +

    Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.

    +
  • +
  • +

    Tree (Class Hierarchy)

    +

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.

    +
      +
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • +
    • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
    • +
    +
  • +
  • +

    Deprecated API

    +

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    +
  • +
  • +

    Index

    +

    The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

    +
  • +
  • +

    Prev/Next

    +

    These links take you to the next or previous class, interface, package, or related page.

    +
  • +
  • +

    Frames/No Frames

    +

    These links show and hide the HTML frames. All pages are available with or without frames.

    +
  • +
  • +

    All Classes

    +

    The All Classes link shows all classes and interfaces except non-static nested types.

    +
  • +
  • +

    Serialized Form

    +

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    +
  • +
  • +

    Constant Field Values

    +

    The Constant Field Values page lists the static final fields and their values.

    +
  • +
+This help file applies to API documentation generated using the standard doclet.
+ + + + + + diff --git a/javadoc/index-files/index-1.html b/javadoc/index-files/index-1.html new file mode 100644 index 0000000..e0dbc82 --- /dev/null +++ b/javadoc/index-files/index-1.html @@ -0,0 +1,130 @@ + + + + + + +E-Index + + + + + + + + +
+ + + + + + + +
+ + +
E G H M O T V      西    + + +

E

+
+
equals(Object) - Method in class org.magiclen.農曆.農曆
+
+
判斷兩農曆物件是否相同。
+
+
+E G H M O T V      西   
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-10.html b/javadoc/index-files/index-10.html new file mode 100644 index 0000000..3828bd0 --- /dev/null +++ b/javadoc/index-files/index-10.html @@ -0,0 +1,130 @@ + + + + + + +是-Index + + + + + + + + +
+ + + + + + + +
+ + +
E G H M O T V      西    + + +

+
+
是否為閏月() - Method in class org.magiclen.農曆.農曆
+
+
判斷農曆月是否為閏月。
+
+
+E G H M O T V      西   
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-11.html b/javadoc/index-files/index-11.html new file mode 100644 index 0000000..9ef28b0 --- /dev/null +++ b/javadoc/index-files/index-11.html @@ -0,0 +1,131 @@ + + + + + + +時-Index + + + + + + + + +
+ + + + + + + +
+ + +
E G H M O T V      西    + + +

+
+
時辰地支(LocalTime) - Static method in class org.magiclen.農曆.農曆
+
+
+ 將時間轉成對應的地支。
+
+
+E G H M O T V      西   
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-12.html b/javadoc/index-files/index-12.html new file mode 100644 index 0000000..75a18bf --- /dev/null +++ b/javadoc/index-files/index-12.html @@ -0,0 +1,130 @@ + + + + + + +版-Index + + + + + + + + +
+ + + + + + + +
+ + +
E G H M O T V      西    + + +

+
+
版本 - Class in org.magiclen.農曆
+
+
農曆的版本。
+
+
+E G H M O T V      西   
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-13.html b/javadoc/index-files/index-13.html new file mode 100644 index 0000000..7df7e9a --- /dev/null +++ b/javadoc/index-files/index-13.html @@ -0,0 +1,166 @@ + + + + + + +西-Index + + + + + + + + +
+ + + + + + + +
+ + +
E G H M O T V      西    + + +

西

+
+
西曆一年有幾天(int) - Static method in class org.magiclen.農曆.農曆
+
+
計算傳入的西曆年共有幾天。
+
+
西曆年範圍正確(int) - Static method in class org.magiclen.農曆.農曆
+
+
+ 判斷傳入的西曆年範圍是否正確。
+
+
西曆年轉農曆地支(int) - Static method in class org.magiclen.農曆.農曆
+
+
將傳入的西曆年轉成農曆對應的地支。
+
+
西曆年轉農曆天干(int) - Static method in class org.magiclen.農曆.農曆
+
+
將傳入的西曆年轉成農曆對應的天干。
+
+
西曆日期是該年的第幾天(int, int, int) - Static method in class org.magiclen.農曆.農曆
+
+
+ 計算傳入的西曆年月日是該西曆年的第幾天。
+
+
西曆日範圍正確且西曆年月也正確(int, int, int) - Static method in class org.magiclen.農曆.農曆
+
+
+ 判斷傳入的西曆日範圍是否正確。
+
+
西曆是閏年(int) - Static method in class org.magiclen.農曆.農曆
+
+
+ 判斷傳入的西曆年是否為閏年。
+
+
西曆月範圍正確(int) - Static method in class org.magiclen.農曆.農曆
+
+
判斷傳入的西曆月範圍是否正確。
+
+
西曆的一個月有幾天(int, int) - Static method in class org.magiclen.農曆.農曆
+
+
計算傳入的西曆年中的西曆月共有幾天。
+
+
+E G H M O T V      西   
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-14.html b/javadoc/index-files/index-14.html new file mode 100644 index 0000000..7763c02 --- /dev/null +++ b/javadoc/index-files/index-14.html @@ -0,0 +1,142 @@ + + + + + + +計-Index + + + + + + + + +
+ + + + + + + +
+ + +
E G H M O T V      西    + + +

+
+
計算八字有幾兩重(農曆, 農曆.地支) - Static method in class org.magiclen.農曆.農曆
+
+
傳入出生年月日和出生時辰(生辰八字),計算此八字有幾兩重。
+
+
計算八字有幾兩重(農曆, LocalTime) - Static method in class org.magiclen.農曆.農曆
+
+
傳入出生年月日和出生時辰(生辰八字),計算此八字有幾兩重。
+
+
計算八字有幾兩重(農曆.地支) - Method in class org.magiclen.農曆.農曆
+
+
傳入出生時辰,和此物件本身的年月日湊成完整的八字,計算八字重量。
+
+
計算八字有幾兩重(LocalTime) - Method in class org.magiclen.農曆.農曆
+
+
傳入出生時辰,和此物件本身的年月日湊成完整的八字,計算八字重量。
+
+
+E G H M O T V      西   
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-15.html b/javadoc/index-files/index-15.html new file mode 100644 index 0000000..4b32ed9 --- /dev/null +++ b/javadoc/index-files/index-15.html @@ -0,0 +1,176 @@ + + + + + + +農-Index + + + + + + + + +
+ + + + + + + +
+ + +
E G H M O T V      西    + + +

+
+
農曆 - Class in org.magiclen.農曆
+
+
+ 在Java上實現出西曆農曆轉換的類別。
+
+
農曆.地支 - Enum in org.magiclen.農曆
+
+
列舉中國十二地支,子、丑、寅、卯、辰、巳、午、未、申、酉、戌、亥。
+
+
農曆.天干 - Enum in org.magiclen.農曆
+
+
列舉中國十天干,甲、乙、丙、丁、戊、己、更、辛、壬、葵。
+
+
農曆.日 - Enum in org.magiclen.農曆
+
+
列舉農曆三十個天數名稱,初一、初二、...
+
+
農曆.月 - Enum in org.magiclen.農曆
+
+
列舉農曆十二個月份名稱,正月、二月、三月、四月、五月、六月、七月、八月、九月、十月、冬月、臘月。
+
+
農曆.生肖 - Enum in org.magiclen.農曆
+
+
列舉中國十二生肖,鼠、牛、虎、兔、龍、蛇、馬、羊、猴、雞、狗、豬。
+
+
農曆一年有幾天(int) - Static method in class org.magiclen.農曆.農曆
+
+
取得傳入的農曆年共有幾天。
+
+
農曆天干地支換算成西曆年(農曆.天干, 農曆.地支) - Static method in class org.magiclen.農曆.農曆
+
+
將農曆的天干地支,轉換成所有可能的西曆年。
+
+
農曆日期是該年的第幾天(int, 農曆.月, boolean, 農曆.日) - Static method in class org.magiclen.農曆.農曆
+
+
+ 計算傳入的農曆年月日是該農曆年的第幾天。
+
+
農曆的一個月有幾天(int, 農曆.月, boolean) - Static method in class org.magiclen.農曆.農曆
+
+
計算傳入的農曆年中的農曆月共有幾天。
+
+
農曆該年的閏月月份(int) - Static method in class org.magiclen.農曆.農曆
+
+
取得農曆該年的閏月月份。
+
+
農曆該年的閏月有幾天(int) - Static method in class org.magiclen.農曆.農曆
+
+
取得農曆該年的閏月有幾天。
+
+
+E G H M O T V      西   
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-2.html b/javadoc/index-files/index-2.html new file mode 100644 index 0000000..e30b597 --- /dev/null +++ b/javadoc/index-files/index-2.html @@ -0,0 +1,130 @@ + + + + + + +G-Index + + + + + + + + +
+ + + + + + + +
+ + +
E G H M O T V      西    + + +

G

+
+
getVersion() - Static method in class org.magiclen.農曆.版本
+
+
取得版本字串。
+
+
+E G H M O T V      西   
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-3.html b/javadoc/index-files/index-3.html new file mode 100644 index 0000000..45f1135 --- /dev/null +++ b/javadoc/index-files/index-3.html @@ -0,0 +1,130 @@ + + + + + + +H-Index + + + + + + + + +
+ + + + + + + +
+ + +
E G H M O T V      西    + + +

H

+
+
hashCode() - Method in class org.magiclen.農曆.農曆
+
+
計算並取得農曆的雜湊值。
+
+
+E G H M O T V      西   
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-4.html b/javadoc/index-files/index-4.html new file mode 100644 index 0000000..48baeb6 --- /dev/null +++ b/javadoc/index-files/index-4.html @@ -0,0 +1,143 @@ + + + + + + +M-Index + + + + + + + + +
+ + + + + + + +
+ + +
E G H M O T V      西    + + +

M

+
+
main(String[]) - Static method in class org.magiclen.農曆.農曆
+
+
+ 程式進入點。
+
+
MAINTENANCE - Static variable in class org.magiclen.農曆.版本
+
+
維護版本號碼。
+
+
MAJOR - Static variable in class org.magiclen.農曆.版本
+
+
主版本號碼。
+
+
MINOR - Static variable in class org.magiclen.農曆.版本
+
+
副版本號碼。
+
+
+E G H M O T V      西   
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-5.html b/javadoc/index-files/index-5.html new file mode 100644 index 0000000..8feba69 --- /dev/null +++ b/javadoc/index-files/index-5.html @@ -0,0 +1,128 @@ + + + + + + +O-Index + + + + + + + + +
+ + + + + + + +
+ + +
E G H M O T V      西    + + +

O

+
+
org.magiclen.農曆 - package org.magiclen.農曆
+
 
+
+E G H M O T V      西   
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-6.html b/javadoc/index-files/index-6.html new file mode 100644 index 0000000..8985e66 --- /dev/null +++ b/javadoc/index-files/index-6.html @@ -0,0 +1,131 @@ + + + + + + +T-Index + + + + + + + + +
+ + + + + + + +
+ + +
E G H M O T V      西    + + +

T

+
+
toString() - Method in class org.magiclen.農曆.農曆
+
+
+ 取得物件字串。
+
+
+E G H M O T V      西   
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-7.html b/javadoc/index-files/index-7.html new file mode 100644 index 0000000..8b664b3 --- /dev/null +++ b/javadoc/index-files/index-7.html @@ -0,0 +1,171 @@ + + + + + + +V-Index + + + + + + + + +
+ + + + + + + +
+ + +
E G H M O T V      西    + + +

V

+
+
valueOf(String) - Static method in enum org.magiclen.農曆.農曆.地支
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.magiclen.農曆.農曆.天干
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.magiclen.農曆.農曆.日
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.magiclen.農曆.農曆.月
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.magiclen.農曆.農曆.生肖
+
+
Returns the enum constant of this type with the specified name.
+
+
values() - Static method in enum org.magiclen.農曆.農曆.地支
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.magiclen.農曆.農曆.天干
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.magiclen.農曆.農曆.日
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.magiclen.農曆.農曆.月
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.magiclen.農曆.農曆.生肖
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
+E G H M O T V      西   
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-8.html b/javadoc/index-files/index-8.html new file mode 100644 index 0000000..8c12d51 --- /dev/null +++ b/javadoc/index-files/index-8.html @@ -0,0 +1,170 @@ + + + + + + +取-Index + + + + + + + + +
+ + + + + + + +
+ + +
E G H M O T V      西    + + +

+
+
取得地支() - Method in class org.magiclen.農曆.農曆
+
+
取得農曆年對應的地支。
+
+
取得天干() - Method in class org.magiclen.農曆.農曆
+
+
取得農曆年對應的天干。
+
+
取得生肖() - Method in class org.magiclen.農曆.農曆
+
+
取得農曆年對應的生肖。
+
+
取得西曆() - Method in class org.magiclen.農曆.農曆
+
+
取得西曆字串。
+
+
取得西曆年() - Method in class org.magiclen.農曆.農曆
+
+
取得西曆年。
+
+
取得西曆日() - Method in class org.magiclen.農曆.農曆
+
+
取得西曆日。
+
+
取得西曆月() - Method in class org.magiclen.農曆.農曆
+
+
取得西曆月。
+
+
取得農曆() - Method in class org.magiclen.農曆.農曆
+
+
取得農曆字串。
+
+
取得農曆年() - Method in class org.magiclen.農曆.農曆
+
+
取得農曆年。
+
+
取得農曆日() - Method in class org.magiclen.農曆.農曆
+
+
取得農曆日。
+
+
取得農曆月() - Method in class org.magiclen.農曆.農曆
+
+
取得農曆月。
+
+
+E G H M O T V      西   
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-9.html b/javadoc/index-files/index-9.html new file mode 100644 index 0000000..72b4bff --- /dev/null +++ b/javadoc/index-files/index-9.html @@ -0,0 +1,136 @@ + + + + + + +建-Index + + + + + + + + +
+ + + + + + + +
+ + +
E G H M O T V      西    + + +

+
+
建立(int, int, int) - Static method in class org.magiclen.農曆.農曆
+
+
+ 建立農曆的類別方法。
+
+
建立(int, 農曆.月, boolean, 農曆.日) - Static method in class org.magiclen.農曆.農曆
+
+
+ 建立農曆的類別方法。
+
+
+E G H M O T V      西   
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index.html b/javadoc/index.html new file mode 100644 index 0000000..399f88f --- /dev/null +++ b/javadoc/index.html @@ -0,0 +1,72 @@ + + + + + + +Generated Documentation (Untitled) + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="org/magiclen/%E8%BE%B2%E6%9B%86/package-summary.html">Non-frame version</a>.</p> + + + diff --git "a/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\347\211\210\346\234\254.html" "b/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\347\211\210\346\234\254.html" new file mode 100644 index 0000000..2267dfa --- /dev/null +++ "b/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\347\211\210\346\234\254.html" @@ -0,0 +1,123 @@ + + + + + + +Uses of Class org.magiclen.農曆.版本 + + + + + + + + + + + +
+

Uses of Class
org.magiclen.農曆.版本

+
+
No usage of org.magiclen.農曆.版本
+ + + + + + diff --git "a/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.html" "b/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.html" new file mode 100644 index 0000000..8899fc9 --- /dev/null +++ "b/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.html" @@ -0,0 +1,186 @@ + + + + + + +Uses of Class org.magiclen.農曆.農曆 + + + + + + + + + + + +
+

Uses of Class
org.magiclen.農曆.農曆

+
+
+ +
+ + + + + + diff --git "a/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.\345\234\260\346\224\257.html" "b/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.\345\234\260\346\224\257.html" new file mode 100644 index 0000000..337c9e9 --- /dev/null +++ "b/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.\345\234\260\346\224\257.html" @@ -0,0 +1,205 @@ + + + + + + +Uses of Class org.magiclen.農曆.農曆.地支 + + + + + + + + + + + +
+

Uses of Class
org.magiclen.農曆.農曆.地支

+
+
+ +
+ + + + + + diff --git "a/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.\345\244\251\345\271\262.html" "b/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.\345\244\251\345\271\262.html" new file mode 100644 index 0000000..31914f9 --- /dev/null +++ "b/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.\345\244\251\345\271\262.html" @@ -0,0 +1,185 @@ + + + + + + +Uses of Class org.magiclen.農曆.農曆.天干 + + + + + + + + + + + +
+

Uses of Class
org.magiclen.農曆.農曆.天干

+
+
+ +
+ + + + + + diff --git "a/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.\346\227\245.html" "b/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.\346\227\245.html" new file mode 100644 index 0000000..d87355e --- /dev/null +++ "b/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.\346\227\245.html" @@ -0,0 +1,192 @@ + + + + + + +Uses of Class org.magiclen.農曆.農曆.日 + + + + + + + + + + + +
+

Uses of Class
org.magiclen.農曆.農曆.日

+
+
+ +
+ + + + + + diff --git "a/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.\346\234\210.html" "b/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.\346\234\210.html" new file mode 100644 index 0000000..ce45b75 --- /dev/null +++ "b/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.\346\234\210.html" @@ -0,0 +1,206 @@ + + + + + + +Uses of Class org.magiclen.農曆.農曆.月 + + + + + + + + + + + +
+

Uses of Class
org.magiclen.農曆.農曆.月

+
+
+ +
+ + + + + + diff --git "a/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.\347\224\237\350\202\226.html" "b/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.\347\224\237\350\202\226.html" new file mode 100644 index 0000000..134dec0 --- /dev/null +++ "b/javadoc/org/magiclen/\350\276\262\346\233\206/class-use/\350\276\262\346\233\206.\347\224\237\350\202\226.html" @@ -0,0 +1,163 @@ + + + + + + +Uses of Class org.magiclen.農曆.農曆.生肖 + + + + + + + + + + + +
+

Uses of Class
org.magiclen.農曆.農曆.生肖

+
+
+ +
+ + + + + + diff --git "a/javadoc/org/magiclen/\350\276\262\346\233\206/package-frame.html" "b/javadoc/org/magiclen/\350\276\262\346\233\206/package-frame.html" new file mode 100644 index 0000000..5bdb65a --- /dev/null +++ "b/javadoc/org/magiclen/\350\276\262\346\233\206/package-frame.html" @@ -0,0 +1,30 @@ + + + + + + +org.magiclen.農曆 + + + + + +

org.magiclen.農曆

+ + + diff --git "a/javadoc/org/magiclen/\350\276\262\346\233\206/package-summary.html" "b/javadoc/org/magiclen/\350\276\262\346\233\206/package-summary.html" new file mode 100644 index 0000000..067d8b6 --- /dev/null +++ "b/javadoc/org/magiclen/\350\276\262\346\233\206/package-summary.html" @@ -0,0 +1,191 @@ + + + + + + +org.magiclen.農曆 + + + + + + + + + + + +
+

Package org.magiclen.農曆

+
+
+
    +
  • + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    版本 +
    農曆的版本。
    +
    農曆 +
    + 在Java上實現出西曆農曆轉換的類別。
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    農曆.天干 +
    列舉中國十天干,甲、乙、丙、丁、戊、己、更、辛、壬、葵。
    +
    農曆.日 +
    列舉農曆三十個天數名稱,初一、初二、...
    +
    農曆.月 +
    列舉農曆十二個月份名稱,正月、二月、三月、四月、五月、六月、七月、八月、九月、十月、冬月、臘月。
    +
    農曆.生肖 +
    列舉中國十二生肖,鼠、牛、虎、兔、龍、蛇、馬、羊、猴、雞、狗、豬。
    +
    農曆.地支 +
    列舉中國十二地支,子、丑、寅、卯、辰、巳、午、未、申、酉、戌、亥。
    +
    +
  • +
+
+ + + + + + diff --git "a/javadoc/org/magiclen/\350\276\262\346\233\206/package-tree.html" "b/javadoc/org/magiclen/\350\276\262\346\233\206/package-tree.html" new file mode 100644 index 0000000..59b1d99 --- /dev/null +++ "b/javadoc/org/magiclen/\350\276\262\346\233\206/package-tree.html" @@ -0,0 +1,149 @@ + + + + + + +org.magiclen.農曆 Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package org.magiclen.農曆

+
+
+

Class Hierarchy

+
    +
  • java.lang.Object + +
  • +
+

Enum Hierarchy

+ +
+ + + + + + diff --git "a/javadoc/org/magiclen/\350\276\262\346\233\206/package-use.html" "b/javadoc/org/magiclen/\350\276\262\346\233\206/package-use.html" new file mode 100644 index 0000000..00e6fdf --- /dev/null +++ "b/javadoc/org/magiclen/\350\276\262\346\233\206/package-use.html" @@ -0,0 +1,169 @@ + + + + + + +Uses of Package org.magiclen.農曆 + + + + + + + + + + + +
+

Uses of Package
org.magiclen.農曆

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Classes in org.magiclen.農曆 used by org.magiclen.農曆 
    Class and Description
    農曆 +
    + 在Java上實現出西曆農曆轉換的類別。
    +
    農曆.天干 +
    列舉中國十天干,甲、乙、丙、丁、戊、己、更、辛、壬、葵。
    +
    農曆.日 +
    列舉農曆三十個天數名稱,初一、初二、...
    +
    農曆.月 +
    列舉農曆十二個月份名稱,正月、二月、三月、四月、五月、六月、七月、八月、九月、十月、冬月、臘月。
    +
    農曆.生肖 +
    列舉中國十二生肖,鼠、牛、虎、兔、龍、蛇、馬、羊、猴、雞、狗、豬。
    +
    農曆.地支 +
    列舉中國十二地支,子、丑、寅、卯、辰、巳、午、未、申、酉、戌、亥。
    +
    +
  • +
+
+ + + + + + diff --git "a/javadoc/org/magiclen/\350\276\262\346\233\206/\347\211\210\346\234\254.html" "b/javadoc/org/magiclen/\350\276\262\346\233\206/\347\211\210\346\234\254.html" new file mode 100644 index 0000000..4c62174 --- /dev/null +++ "b/javadoc/org/magiclen/\350\276\262\346\233\206/\347\211\210\346\234\254.html" @@ -0,0 +1,327 @@ + + + + + + +版本 + + + + + + + + + + + + +
+
org.magiclen.農曆
+

Class 版本

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.magiclen.農曆.版本
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class 版本
    +extends java.lang.Object
    +
    農曆的版本。
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      static intMAINTENANCE +
      維護版本號碼。
      +
      static intMAJOR +
      主版本號碼。
      +
      static intMINOR +
      副版本號碼。
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static java.lang.StringgetVersion() +
      取得版本字串。
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        MAJOR

        +
        public static final int MAJOR
        +
        主版本號碼。當程式架構有了重大改變,將會調整這項數值。
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        MINOR

        +
        public static final int MINOR
        +
        副版本號碼。當程式新增了功能,將會調整這項數值。
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        MAINTENANCE

        +
        public static final int MAINTENANCE
        +
        維護版本號碼。當程式優化或是修正了一些問題,將會調整這項數值。
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getVersion

        +
        public static java.lang.String getVersion()
        +
        取得版本字串。
        +
        +
        Returns:
        +
        傳回版本字串
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git "a/javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.html" "b/javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.html" new file mode 100644 index 0000000..d78ac98 --- /dev/null +++ "b/javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.html" @@ -0,0 +1,1167 @@ + + + + + + +農曆 + + + + + + + + + + + + +
+
org.magiclen.農曆
+

Class 農曆

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.magiclen.農曆.農曆
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class 農曆
    +extends java.lang.Object
    +

    + 在Java上實現出西曆農曆轉換的類別。可支援的西曆範圍為1901/2/19~2050/12/31。 +

    +

    + 提供有關於西曆、農曆的類別方法。可藉由產生實體達成西曆農曆轉換的功能,而產生實體需使用類別提供的建立方法。 +

    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        main

        +
        public static void main(java.lang.String[] 參數)
        +

        + 程式進入點。若以農曆類別作為程式進入點,則預設顯示今天的西曆與農曆日期。如果有傳入YYYY MM + DD三項西曆日期參數,則顯示傳入的該天之西曆與農曆日期。

        +
        +
        Parameters:
        +
        參數 - 傳入西曆年、月、日
        +
        +
      • +
      + + + +
        +
      • +

        西曆年範圍正確

        +
        public static boolean 西曆年範圍正確(int 西曆年)
        +

        + 判斷傳入的西曆年範圍是否正確。同樣適用於農曆年。 +

        +
        +
        Parameters:
        +
        西曆年 - 傳入西曆年。
        +
        Returns:
        +
        傳回西曆年範圍是否正確。
        +
        +
      • +
      + + + +
        +
      • +

        西曆月範圍正確

        +
        public static boolean 西曆月範圍正確(int 西曆月)
        +
        判斷傳入的西曆月範圍是否正確。
        +
        +
        Parameters:
        +
        西曆月 - 傳入西曆月。
        +
        Returns:
        +
        傳回西曆月範圍是否正確。
        +
        +
      • +
      + + + +
        +
      • +

        西曆日範圍正確且西曆年月也正確

        +
        public static boolean 西曆日範圍正確且西曆年月也正確(int 西曆年,
        +                                      int 西曆月,
        +                                      int 西曆日)
        +

        + 判斷傳入的西曆日範圍是否正確。若正確,表示傳入的西曆日和西曆月也正確。 +

        +
        +
        Parameters:
        +
        西曆年 - 傳入西曆年。
        +
        西曆月 - 傳入西曆月。
        +
        西曆日 - 傳入西曆日。
        +
        Returns:
        +
        傳回西曆年、月、日範圍是否正確。
        +
        +
      • +
      + + + +
        +
      • +

        西曆是閏年

        +
        public static boolean 西曆是閏年(int 西曆年)
        +

        + 判斷傳入的西曆年是否為閏年。(四年閏、四百年閏、百年不閏)

        +
        +
        Parameters:
        +
        西曆年 - 傳入西曆年。
        +
        Returns:
        +
        傳回傳入的西曆年是否為閏年。
        +
        +
      • +
      + + + +
        +
      • +

        西曆一年有幾天

        +
        public static int 西曆一年有幾天(int 西曆年)
        +
        計算傳入的西曆年共有幾天。
        +
        +
        Parameters:
        +
        西曆年 - 傳入西曆年。
        +
        Returns:
        +
        傳回西曆年含有的天數。傳入數值範圍若有誤,則回傳0。
        +
        +
      • +
      + + + +
        +
      • +

        西曆的一個月有幾天

        +
        public static int 西曆的一個月有幾天(int 西曆年,
        +                            int 西曆月)
        +
        計算傳入的西曆年中的西曆月共有幾天。
        +
        +
        Parameters:
        +
        西曆年 - 傳入西曆年。
        +
        西曆月 - 傳入西曆月。
        +
        Returns:
        +
        傳回西曆年中的西曆月共有幾天。傳入數值範圍若有誤,則回傳0。
        +
        +
      • +
      + + + +
        +
      • +

        西曆日期是該年的第幾天

        +
        public static int 西曆日期是該年的第幾天(int 西曆年,
        +                              int 西曆月,
        +                              int 西曆日)
        +

        + 計算傳入的西曆年月日是該西曆年的第幾天。舉例:2013/1/4,就是第4天。

        +
        +
        Parameters:
        +
        西曆年 - 傳入西曆年。
        +
        西曆月 - 傳入西曆月。
        +
        西曆日 - 傳入西曆日。
        +
        Returns:
        +
        傳回傳入的西曆年月日是該西曆年的第幾天。傳入數值範圍若有誤,則回傳0。
        +
        +
      • +
      + + + +
        +
      • +

        農曆日期是該年的第幾天

        +
        public static int 農曆日期是該年的第幾天(int 農曆年,
        +                              農曆.月 農曆月,
        +                              boolean 是閏月,
        +                              農曆.日 農曆日)
        +

        + 計算傳入的農曆年月日是該農曆年的第幾天。舉例:2013/正月/初五,就是第5天。

        +
        +
        Parameters:
        +
        農曆年 - 傳入農曆年。
        +
        農曆月 - 傳入農曆月。
        +
        是閏月 - 傳入的農曆月是否為閏月。
        +
        農曆日 - 傳入農曆日。
        +
        Returns:
        +
        傳回傳入的農曆年月日是該農曆年的第幾天。傳入數值範圍若有誤,則回傳0。
        +
        +
      • +
      + + + +
        +
      • +

        西曆年轉農曆天干

        +
        public static 農曆.天干 西曆年轉農曆天干(int 西曆年)
        +
        將傳入的西曆年轉成農曆對應的天干。
        +
        +
        Parameters:
        +
        西曆年 - 傳入西曆年。
        +
        Returns:
        +
        傳回傳入的西曆年所對應的天干。傳入數值範圍若有誤,則回傳null。
        +
        +
      • +
      + + + +
        +
      • +

        西曆年轉農曆地支

        +
        public static 農曆.地支 西曆年轉農曆地支(int 西曆年)
        +
        將傳入的西曆年轉成農曆對應的地支。
        +
        +
        Parameters:
        +
        西曆年 - 傳入西曆年。
        +
        Returns:
        +
        傳回傳入的西曆年所對應的地支。傳入數值範圍若有誤,則回傳null。
        +
        +
      • +
      + + + +
        +
      • +

        農曆天干地支換算成西曆年

        +
        public static int[] 農曆天干地支換算成西曆年(農曆.天干 農曆年天干,
        +                                 農曆.地支 農曆年地支)
        +
        將農曆的天干地支,轉換成所有可能的西曆年。
        +
        +
        Parameters:
        +
        農曆年天干 - 傳入農曆天干。
        +
        農曆年地支 - 傳入農曆地支。
        +
        Returns:
        +
        以整數陣列的形式,傳回天干地支可能對應的所有西曆年。
        +
        +
      • +
      + + + +
        +
      • +

        農曆該年的閏月月份

        +
        public static 農曆.月 農曆該年的閏月月份(int 農曆年)
        +
        取得農曆該年的閏月月份。
        +
        +
        Parameters:
        +
        農曆年 - 傳入農曆年。
        +
        Returns:
        +
        傳回農曆該年對應的閏月月份。傳入數值範圍若有誤,則回傳null。
        +
        +
      • +
      + + + +
        +
      • +

        農曆該年的閏月有幾天

        +
        public static int 農曆該年的閏月有幾天(int 農曆年)
        +
        取得農曆該年的閏月有幾天。
        +
        +
        Parameters:
        +
        農曆年 - 傳入農曆年。
        +
        Returns:
        +
        傳回農曆該年對應的閏月有幾天。傳入數值範圍若有誤或是沒有閏月,則回傳0。
        +
        +
      • +
      + + + +
        +
      • +

        農曆的一個月有幾天

        +
        public static int 農曆的一個月有幾天(int 農曆年,
        +                            農曆.月 農曆月,
        +                            boolean 是閏月)
        +
        計算傳入的農曆年中的農曆月共有幾天。
        +
        +
        Parameters:
        +
        農曆年 - 傳入農曆年。
        +
        農曆月 - 傳入農曆月。
        +
        是閏月 - 傳入的農曆月是否為閏月。
        +
        Returns:
        +
        傳回農曆年中的農曆月共有幾天。傳入數值範圍若有誤,則回傳0。
        +
        +
      • +
      + + + +
        +
      • +

        農曆一年有幾天

        +
        public static int 農曆一年有幾天(int 農曆年)
        +
        取得傳入的農曆年共有幾天。
        +
        +
        Parameters:
        +
        農曆年 - 傳入農曆年。
        +
        Returns:
        +
        傳回農曆年含有的天數。傳入數值範圍若有誤,則回傳0。
        +
        +
      • +
      + + + +
        +
      • +

        計算八字有幾兩重

        +
        public static float 計算八字有幾兩重(農曆 出生年月日,
        +                             農曆.地支 出生時辰)
        +
        傳入出生年月日和出生時辰(生辰八字),計算此八字有幾兩重。
        +
        +
        Parameters:
        +
        出生年月日 - 傳入此農曆類別的出生年月日。
        +
        出生時辰 -

        + 傳入以地支表示的出生時辰。(子:23~1、丑:1~3、寅:3~5、卯:5~7、辰:7~9、巳:9~11、午:11~13、未:13~15、申:15~17、酉:17~19、戌:19~21、亥:21~23) +

        +
        Returns:
        +
        傳回八字計算之後的重量(單位:兩)。
        +
        +
      • +
      + + + +
        +
      • +

        計算八字有幾兩重

        +
        public static float 計算八字有幾兩重(農曆 出生年月日,
        +                             java.time.LocalTime 時間)
        +
        傳入出生年月日和出生時辰(生辰八字),計算此八字有幾兩重。
        +
        +
        Parameters:
        +
        出生年月日 - 傳入此農曆類別的出生年月日。
        +
        時間 - 傳入時間
        +
        Returns:
        +
        傳回八字計算之後的重量(單位:兩)。
        +
        +
      • +
      + + + +
        +
      • +

        建立

        +
        public static 農曆 建立(int 西曆年,
        +                    int 西曆月,
        +                    int 西曆日)
        +

        + 建立農曆的類別方法。傳入西曆年、月、日。

        +
        +
        Parameters:
        +
        西曆年 - 傳入西曆年。
        +
        西曆月 - 傳入西曆月。
        +
        西曆日 - 傳入西曆日。
        +
        Returns:
        +
        傳回建立出來的農曆實體。
        +
        +
      • +
      + + + +
        +
      • +

        建立

        +
        public static 農曆 建立(int 農曆年,
        +                    農曆.月 農曆月,
        +                    boolean 是閏月,
        +                    農曆.日 農曆日)
        +

        + 建立農曆的類別方法。傳入農曆年、月、日。

        +
        +
        Parameters:
        +
        農曆年 - 傳入農曆年。
        +
        農曆月 - 傳入農曆月。
        +
        是閏月 - 傳入的農曆月是否為閏月。
        +
        農曆日 - 傳入農曆日。
        +
        Returns:
        +
        傳回建立出來的農曆實體。
        +
        +
      • +
      + + + +
        +
      • +

        時辰地支

        +
        public static 農曆.地支 時辰地支(java.time.LocalTime 時間)
        +

        + 將時間轉成對應的地支。 +

        +
        +
        Parameters:
        +
        時間 - 傳入時間
        +
        Returns:
        +
        傳回時間對應的地支
        +
        +
      • +
      + + + +
        +
      • +

        取得西曆年

        +
        public int 取得西曆年()
        +
        取得西曆年。
        +
        +
        Returns:
        +
        傳回西曆年。
        +
        +
      • +
      + + + +
        +
      • +

        取得西曆月

        +
        public int 取得西曆月()
        +
        取得西曆月。
        +
        +
        Returns:
        +
        傳回西曆月。
        +
        +
      • +
      + + + +
        +
      • +

        取得西曆日

        +
        public int 取得西曆日()
        +
        取得西曆日。
        +
        +
        Returns:
        +
        傳回西曆日。
        +
        +
      • +
      + + + +
        +
      • +

        取得農曆年

        +
        public int 取得農曆年()
        +
        取得農曆年。
        +
        +
        Returns:
        +
        傳回農曆年。
        +
        +
      • +
      + + + +
        +
      • +

        取得天干

        +
        public 農曆.天干 取得天干()
        +
        取得農曆年對應的天干。
        +
        +
        Returns:
        +
        傳回天干。
        +
        +
      • +
      + + + +
        +
      • +

        取得地支

        +
        public 農曆.地支 取得地支()
        +
        取得農曆年對應的地支。
        +
        +
        Returns:
        +
        傳回地支。
        +
        +
      • +
      + + + +
        +
      • +

        取得農曆月

        +
        public 農曆.月 取得農曆月()
        +
        取得農曆月。
        +
        +
        Returns:
        +
        傳回農曆月。
        +
        +
      • +
      + + + +
        +
      • +

        取得農曆日

        +
        public 農曆.日 取得農曆日()
        +
        取得農曆日。
        +
        +
        Returns:
        +
        傳回農曆日。
        +
        +
      • +
      + + + +
        +
      • +

        是否為閏月

        +
        public boolean 是否為閏月()
        +
        判斷農曆月是否為閏月。
        +
        +
        Returns:
        +
        傳回農曆月是否為閏月。
        +
        +
      • +
      + + + +
        +
      • +

        取得生肖

        +
        public 農曆.生肖 取得生肖()
        +
        取得農曆年對應的生肖。
        +
        +
        Returns:
        +
        傳回生肖。
        +
        +
      • +
      + + + +
        +
      • +

        計算八字有幾兩重

        +
        public float 計算八字有幾兩重(農曆.地支 出生時辰)
        +
        傳入出生時辰,和此物件本身的年月日湊成完整的八字,計算八字重量。
        +
        +
        Parameters:
        +
        出生時辰 -

        + 傳入以地支表示的出生時辰。(子:23~1、丑:1~3、寅:3~5、卯:5~7、辰:7~9、巳:9~11、午:11~13、未:13~15、申:15~17、酉:17~19、戌:19~21、亥:21~23)

        +
        Returns:
        +
        傳回八字計算之後的重量(單位:兩)。
        +
        +
      • +
      + + + +
        +
      • +

        計算八字有幾兩重

        +
        public float 計算八字有幾兩重(java.time.LocalTime 時間)
        +
        傳入出生時辰,和此物件本身的年月日湊成完整的八字,計算八字重量。
        +
        +
        Parameters:
        +
        時間 - 傳入時間
        +
        Returns:
        +
        傳回八字計算之後的重量(單位:兩)。
        +
        +
      • +
      + + + +
        +
      • +

        取得農曆

        +
        public java.lang.String 取得農曆()
        +
        取得農曆字串。
        +
        +
        Returns:
        +
        傳回農曆字串。
        +
        +
      • +
      + + + +
        +
      • +

        取得西曆

        +
        public java.lang.String 取得西曆()
        +
        取得西曆字串。
        +
        +
        Returns:
        +
        傳回西曆字串。
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +

        + 取得物件字串。包含著西曆與農曆的年月日

        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        Returns:
        +
        傳回物件字串。
        +
        +
      • +
      + + + +
        +
      • +

        equals

        +
        public boolean equals(java.lang.Object 物件)
        +
        判斷兩農曆物件是否相同。
        +
        +
        Overrides:
        +
        equals in class java.lang.Object
        +
        Parameters:
        +
        物件 - 傳入物件。
        +
        Returns:
        +
        傳回兩農曆物件是否相同(西曆農曆日期相同)。
        +
        +
      • +
      + + + +
        +
      • +

        hashCode

        +
        public int hashCode()
        +
        計算並取得農曆的雜湊值。
        +
        +
        Overrides:
        +
        hashCode in class java.lang.Object
        +
        Returns:
        +
        傳回農曆的雜湊值。
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git "a/javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.\345\234\260\346\224\257.html" "b/javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.\345\234\260\346\224\257.html" new file mode 100644 index 0000000..540f044 --- /dev/null +++ "b/javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.\345\234\260\346\224\257.html" @@ -0,0 +1,465 @@ + + + + + + +農曆.地支 + + + + + + + + + + + + +
+
org.magiclen.農曆
+

Enum 農曆.地支

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Enum<農曆.地支>
    • +
    • +
        +
      • org.magiclen.農曆.農曆.地支
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<農曆.地支>
    +
    +
    +
    Enclosing class:
    +
    農曆
    +
    +
    +
    +
    public static enum 農曆.地支
    +extends java.lang.Enum<農曆.地支>
    +
    列舉中國十二地支,子、丑、寅、卯、辰、巳、午、未、申、酉、戌、亥。
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
       
       
       
       
       
       
       
       
       
       
       
       
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static 農曆.地支valueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static 農曆.地支[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static 農曆.地支[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (農曆.地支 c : 農曆.地支.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static 農曆.地支 valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git "a/javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.\345\244\251\345\271\262.html" "b/javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.\345\244\251\345\271\262.html" new file mode 100644 index 0000000..b48831a --- /dev/null +++ "b/javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.\345\244\251\345\271\262.html" @@ -0,0 +1,441 @@ + + + + + + +農曆.天干 + + + + + + + + + + + + +
+
org.magiclen.農曆
+

Enum 農曆.天干

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Enum<農曆.天干>
    • +
    • +
        +
      • org.magiclen.農曆.農曆.天干
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<農曆.天干>
    +
    +
    +
    Enclosing class:
    +
    農曆
    +
    +
    +
    +
    public static enum 農曆.天干
    +extends java.lang.Enum<農曆.天干>
    +
    列舉中國十天干,甲、乙、丙、丁、戊、己、更、辛、壬、葵。
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
       
       
       
       
       
       
       
       
       
       
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static 農曆.天干valueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static 農曆.天干[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static 農曆.天干[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (農曆.天干 c : 農曆.天干.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static 農曆.天干 valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git "a/javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.\346\227\245.html" "b/javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.\346\227\245.html" new file mode 100644 index 0000000..b36b69b --- /dev/null +++ "b/javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.\346\227\245.html" @@ -0,0 +1,681 @@ + + + + + + +農曆.日 + + + + + + + + + + + + +
+
org.magiclen.農曆
+

Enum 農曆.日

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Enum<農曆.日>
    • +
    • +
        +
      • org.magiclen.農曆.農曆.日
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<農曆.日>
    +
    +
    +
    Enclosing class:
    +
    農曆
    +
    +
    +
    +
    public static enum 農曆.日
    +extends java.lang.Enum<農曆.日>
    +
    列舉農曆三十個天數名稱,初一、初二、...、十一、十二、...、廿一、廿二、...、三十。
    +
  • +
+
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static 農曆.日[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (農曆.日 c : 農曆.日.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static 農曆.日 valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git "a/javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.\346\234\210.html" "b/javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.\346\234\210.html" new file mode 100644 index 0000000..fe7f9b4 --- /dev/null +++ "b/javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.\346\234\210.html" @@ -0,0 +1,465 @@ + + + + + + +農曆.月 + + + + + + + + + + + + +
+
org.magiclen.農曆
+

Enum 農曆.月

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Enum<農曆.月>
    • +
    • +
        +
      • org.magiclen.農曆.農曆.月
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<農曆.月>
    +
    +
    +
    Enclosing class:
    +
    農曆
    +
    +
    +
    +
    public static enum 農曆.月
    +extends java.lang.Enum<農曆.月>
    +
    列舉農曆十二個月份名稱,正月、二月、三月、四月、五月、六月、七月、八月、九月、十月、冬月、臘月。
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static 農曆.月valueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static 農曆.月[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static 農曆.月[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (農曆.月 c : 農曆.月.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static 農曆.月 valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git "a/javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.\347\224\237\350\202\226.html" "b/javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.\347\224\237\350\202\226.html" new file mode 100644 index 0000000..f82608e --- /dev/null +++ "b/javadoc/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.\347\224\237\350\202\226.html" @@ -0,0 +1,465 @@ + + + + + + +農曆.生肖 + + + + + + + + + + + + +
+
org.magiclen.農曆
+

Enum 農曆.生肖

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Enum<農曆.生肖>
    • +
    • +
        +
      • org.magiclen.農曆.農曆.生肖
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<農曆.生肖>
    +
    +
    +
    Enclosing class:
    +
    農曆
    +
    +
    +
    +
    public static enum 農曆.生肖
    +extends java.lang.Enum<農曆.生肖>
    +
    列舉中國十二生肖,鼠、牛、虎、兔、龍、蛇、馬、羊、猴、雞、狗、豬。
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
       
       
       
       
       
       
       
       
       
       
       
       
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static 農曆.生肖valueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static 農曆.生肖[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static 農曆.生肖[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (農曆.生肖 c : 農曆.生肖.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static 農曆.生肖 valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/overview-tree.html b/javadoc/overview-tree.html new file mode 100644 index 0000000..f3aead5 --- /dev/null +++ b/javadoc/overview-tree.html @@ -0,0 +1,153 @@ + + + + + + +Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For All Packages

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object + +
  • +
+

Enum Hierarchy

+ +
+ + + + + + diff --git a/javadoc/package-list b/javadoc/package-list new file mode 100644 index 0000000..2e09ac1 --- /dev/null +++ b/javadoc/package-list @@ -0,0 +1 @@ +org.magiclen.農曆 diff --git a/javadoc/script.js b/javadoc/script.js new file mode 100644 index 0000000..b346356 --- /dev/null +++ b/javadoc/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} diff --git a/javadoc/stylesheet.css b/javadoc/stylesheet.css new file mode 100644 index 0000000..98055b2 --- /dev/null +++ b/javadoc/stylesheet.css @@ -0,0 +1,574 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git "a/src/org/magiclen/\350\276\262\346\233\206/\347\211\210\346\234\254.java" "b/src/org/magiclen/\350\276\262\346\233\206/\347\211\210\346\234\254.java" new file mode 100644 index 0000000..ce6f954 --- /dev/null +++ "b/src/org/magiclen/\350\276\262\346\233\206/\347\211\210\346\234\254.java" @@ -0,0 +1,55 @@ +/* + * + * Copyright 2015-2016 magiclen.org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.magiclen.農曆; + +/** + * 農曆的版本。 + * + * @author Magic Len + */ +public final class 版本 { + + /** + * 主版本號碼。當程式架構有了重大改變,將會調整這項數值。 + */ + public static final int MAJOR = 2; + /** + * 副版本號碼。當程式新增了功能,將會調整這項數值。 + */ + public static final int MINOR = 1; + /** + * 維護版本號碼。當程式優化或是修正了一些問題,將會調整這項數值。 + */ + public static final int MAINTENANCE = 1; + + /** + * 私有的建構子,將無法被實體化。 + */ + private 版本() { + + } + + /** + * 取得版本字串。 + * + * @return 傳回版本字串 + */ + public static String getVersion() { + return String.format("%d.%d.%d", MAJOR, MINOR, MAINTENANCE); + } +} diff --git "a/src/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.java" "b/src/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.java" new file mode 100644 index 0000000..eccbb87 --- /dev/null +++ "b/src/org/magiclen/\350\276\262\346\233\206/\350\276\262\346\233\206.java" @@ -0,0 +1,921 @@ +/* + * + * Copyright 2015-2016 magiclen.org + * + * Licensed under the Apache License, 版本 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.magiclen.農曆; + +import java.time.LocalDate; +import java.time.LocalTime; +import java.time.temporal.Temporal; +import java.util.ArrayList; + +/** + *

+ * 在Java上實現出西曆農曆轉換的類別。可支援的西曆範圍為1901/2/19~2050/12/31。 + *

+ *

+ * 提供有關於西曆、農曆的類別方法。可藉由產生實體達成西曆農曆轉換的功能,而產生實體需使用類別提供的建立方法。 + *

+ * + * @author Magic Len + */ +public class 農曆 { + + // -----類別列舉----- + /** + * 列舉中國十天干,甲、乙、丙、丁、戊、己、更、辛、壬、葵。 + */ + public static enum 天干 { + + 甲, 乙, 丙, 丁, 戊, 己, 庚, 辛, 壬, 癸; + } + + /** + * 列舉中國十二地支,子、丑、寅、卯、辰、巳、午、未、申、酉、戌、亥。 + */ + public static enum 地支 { + + 子, 丑, 寅, 卯, 辰, 巳, 午, 未, 申, 酉, 戌, 亥; + } + + /** + * 列舉中國十二生肖,鼠、牛、虎、兔、龍、蛇、馬、羊、猴、雞、狗、豬。 + */ + public static enum 生肖 { + + 鼠, 牛, 虎, 兔, 龍, 蛇, 馬, 羊, 猴, 雞, 狗, 豬; + } + + /** + * 列舉農曆十二個月份名稱,正月、二月、三月、四月、五月、六月、七月、八月、九月、十月、冬月、臘月。 + */ + public static enum 月 { + + 正月, 二月, 三月, 四月, 五月, 六月, 七月, 八月, 九月, 十月, 冬月, 臘月; + } + + /** + * 列舉農曆三十個天數名稱,初一、初二、...、十一、十二、...、廿一、廿二、...、三十。 + */ + public static enum 日 { + + 初一, 初二, 初三, 初四, 初五, 初六, 初七, 初八, 初九, 初十, 十一, 十二, 十三, 十四, 十五, 十六, 十七, 十八, 十九, 二十, 廿一, 廿二, 廿三, 廿四, 廿五, 廿六, 廿七, 廿八, 廿九, 三十; + } + + // -----類別常數----- + /** + * 本類別可從西元1901開始計算到的最大西曆年。 + */ + private static final int 最大西曆年 = 2050; + + /** + * int型別有32位元(31...0),將第15~3個位元用來分別表示1~13月(含閏年)是否為大月(1為大月有30天;0為小月有29天)。此處有西元1901~2050年的資料。 + */ + private static final int[] 大月 = { + 0x4ae0, 0xa570, 0x5268, 0xd260, 0xd950, 0x6aa8, 0x56a0, 0x9ad0, 0x4ae8, 0x4ae0, //1910 + 0xa4d8, 0xa4d0, 0xd250, 0xd528, 0xb540, 0xd6a0, 0x96d0, 0x95b0, 0x49b8, 0x4970, //1920 + 0xa4b0, 0xb258, 0x6a50, 0x6d40, 0xada8, 0x2b60, 0x9570, 0x4978, 0x4970, 0x64b0, //1930 + 0xd4a0, 0xea50, 0x6d48, 0x5ad0, 0x2b60, 0x9370, 0x92e0, 0xc968, 0xc950, 0xd4a0, //1940 + 0xda50, 0xb550, 0x56a0, 0xaad8, 0x25d0, 0x92d0, 0xc958, 0xa950, 0xb4a8, 0x6ca0, //1950 + 0xb550, 0x55a8, 0x4da0, 0xa5b0, 0x52b8, 0x52b0, 0xa950, 0xe950, 0x6aa0, 0xad50, //1960 + 0xab50, 0x4b60, 0xa570, 0xa570, 0x5260, 0xe930, 0xd950, 0x5aa8, 0x56a0, 0x96d0, //1970 + 0x4ae8, 0x4ad0, 0xa4d0, 0xd268, 0xd250, 0xd528, 0xb540, 0xb6a0, 0x96d0, 0x95b0, //1980 + 0x49b0, 0xa4b8, 0xa4b0, 0xb258, 0x6a50, 0x6d40, 0xada0, 0xab60, 0x9570, 0x4978, //1990 + 0x4970, 0x64b0, 0x6a50, 0xea50, 0x6b28, 0x5ac0, 0xab60, 0x9368, 0x92e0, 0xc960, //2000 + 0xd4a8, 0xd4a0, 0xda50, 0x5aa8, 0x56a0, 0xaad8, 0x25d0, 0x92d0, 0xc958, 0xa950, //2010 + 0xb4a0, 0xb550, 0xad50, 0x55a8, 0x4ba0, 0xa5b0, 0x52b8, 0x52b0, 0xa930, 0x74a8, //2020 + 0x6aa0, 0xad50, 0x4da8, 0x4b60, 0xa570, 0xa4e0, 0xd260, 0xe930, 0xd530, 0x5aa0, //2030 + 0x6b50, 0x96d0, 0x4ae8, 0x4ad0, 0xa4d0, 0xd258, 0xd250, 0xd520, 0xdaa0, 0xb5a0, //2040 + 0x56d0, 0x4ad8, 0x49b0, 0xa4b8, 0xa4b0, 0xaa50, 0xb528, 0x6d20, 0xada0, 0x55b0 //2050 + }; + + /** + * int型別有32位元(31...0),兩年一組,將第15~8個位元用來表示第一年是閏幾月,第7~0個位元用來表示第二年是閏幾月。若該年數值為0,表示該年沒有閏月。此處有西元1901~2050年的資料。 + */ + private static final int[] 閏月 = { + 0x00, 0x50, 0x04, 0x00, 0x20, //1910 + 0x60, 0x05, 0x00, 0x20, 0x70, //1920 + 0x05, 0x00, 0x40, 0x02, 0x06, //1930 + 0x00, 0x50, 0x03, 0x07, 0x00, //1940 + 0x60, 0x04, 0x00, 0x20, 0x70, //1950 + 0x05, 0x00, 0x30, 0x80, 0x06, //1960 + 0x00, 0x40, 0x03, 0x07, 0x00, //1970 + 0x50, 0x04, 0x08, 0x00, 0x60, //1980 + 0x04, 0x0a, 0x00, 0x60, 0x05, //1990 + 0x00, 0x30, 0x80, 0x05, 0x00, //2000 + 0x40, 0x02, 0x07, 0x00, 0x50, //2010 + 0x04, 0x09, 0x00, 0x60, 0x04, //2020 + 0x00, 0x20, 0x60, 0x05, 0x00, //2030 + 0x30, 0xb0, 0x06, 0x00, 0x50, //2040 + 0x02, 0x07, 0x00, 0x50, 0x03 //2050 + }; + + /** + * 儲存西曆年和農曆年開始(該年第一天)的偏差量(天數)。此處有西元1901~2050年的資料。 + */ + private static final int[] 新年偏差 = { + 49, 38, 28, 46, 34, 24, 43, 32, 21, 40, //1910 + 29, 48, 36, 25, 44, 33, 22, 41, 31, 50, //1920 + 38, 27, 46, 35, 23, 43, 32, 22, 40, 29, //1930 + 47, 36, 25, 44, 34, 23, 41, 30, 49, 38, //1940 + 26, 45, 35, 24, 43, 32, 21, 40, 28, 47, //1950 + 36, 26, 44, 33, 23, 42, 30, 48, 38, 27, //1960 + 45, 35, 24, 43, 32, 20, 39, 29, 47, 36, //1970 + 26, 45, 33, 22, 41, 30, 48, 37, 27, 46, //1980 + 35, 24, 43, 32, 50, 39, 28, 47, 36, 26, //1990 + 45, 34, 22, 40, 30, 49, 37, 27, 46, 35, //2000 + 23, 42, 31, 21, 39, 28, 48, 37, 25, 44, //2010 + 33, 22, 40, 30, 49, 38, 27, 46, 35, 24, //2020 + 42, 31, 21, 40, 28, 47, 36, 25, 43, 33, //2030 + 22, 41, 30, 49, 38, 27, 45, 34, 23, 42, //2040 + 31, 21, 40, 29, 47, 36, 25, 44, 32, 22 //2050 + }; + + /** + * 從甲子年到癸亥年共六十年的八字重量。 + */ + private static final int[] 年八字重量 = { + 12, 9, 6, 7, 12, 5, 9, 8, 7, 8, 15, 9, + 16, 8, 8, 12, 12, 6, 8, 7, 5, 15, 6, 16, + 15, 8, 9, 12, 1, 7, 15, 6, 5, 14, 14, 9, + 7, 7, 9, 12, 8, 7, 13, 5, 14, 5, 9, 17, + 5, 7, 12, 8, 8, 6, 19, 6, 8, 16, 1, 7 + }; + + /** + * 從正月到臘月共十二個月的八字重量。 + */ + private static final int[] 月八字重量 = { + 6, 7, 18, 9, 5, 16, 9, 15, 18, 8, 9, 5 + }; + + /** + * 從初一到三十共三十天的八字重量。 + */ + private static final int[] 日八字重量 = { + 5, 10, 8, 15, 16, 15, 8, 16, 8, 16, + 9, 17, 8, 17, 10, 8, 9, 18, 5, 15, + 10, 9, 8, 9, 15, 18, 7, 8, 16, 6 + }; + + /** + * 從子時到亥時共十二地支的八字重量。 + */ + private static final int[] 時辰八字重量 = { + 16, 6, 7, 1, 9, 16, 1, 8, 8, 9, 6, 6, 16 + }; + + //-------------------------------類別方法------------------------------- + /** + *

+ * 程式進入點。若以農曆類別作為程式進入點,則預設顯示今天的西曆與農曆日期。如果有傳入YYYY MM + * DD三項西曆日期參數,則顯示傳入的該天之西曆與農曆日期。

+ * + * @param 參數 傳入西曆年、月、日 + */ + public static void main(final String[] 參數) { + final 農曆 農曆一; + if (參數.length != 3) { + final LocalDate currentLocalDate = LocalDate.now(); + 農曆一 = 農曆.建立(currentLocalDate.getYear(), currentLocalDate.getMonthValue(), currentLocalDate.getDayOfMonth()); + } else { + try { + 農曆一 = 農曆.建立(Integer.parseInt(參數[0]), Integer.parseInt(參數[1]), Integer.parseInt(參數[2])); + } catch (final Exception e) { + System.out.println("不支援的日期"); + return; + } + } + System.out.println(農曆一); + } + + /** + *

+ * 自我測試類別。用以驗證使用本程式轉換的西曆與農曆之正確性。若檢查到錯誤會顯示出來。 + *

+ */ + private static void 自動化自我測試() { + 農曆 農曆一, 農曆二; //A用西曆建立農曆,B用農曆建立西曆 + for (int 年 = 1901; 年 <= 2050; ++年) { + for (int 月 = 1; 月 <= 12; ++月) { + for (int 日 = 1; 日 <= 31; ++日) { + //西曆建立農曆 + 農曆一 = 農曆.建立(年, 月, 日); + if (農曆一 == null) { + //沒有這個西曆日期 + continue; + } + //用A轉換出的農曆套給B + 農曆二 = 農曆.建立(農曆一.農曆年, 農曆一.農曆月, 農曆一.是否為閏月(), 農曆一.農曆日); //B用農曆建立西曆 + if (農曆二 == null) { + System.err.printf("-----%n此筆資料無法建立出農曆%n%s%n-----%n", 農曆一); + continue; + } + if (!農曆一.equals(農曆二)) { //西曆和農曆互轉必須為相同的結果,所以若A、B不同,表示計算結果有誤。 + System.err.printf("-----%n資料不相等農曆%nA%n%s%n-%nB%n%s%n-----%n", 農曆一, 農曆二); + } + } + } + } + System.out.println("自動化測試結束"); + } + + /** + *

+ * 判斷傳入的西曆年範圍是否正確。同樣適用於農曆年。 + *

+ * + * @param 西曆年 傳入西曆年。 + * @return 傳回西曆年範圍是否正確。 + */ + public static boolean 西曆年範圍正確(final int 西曆年) { + return 西曆年 > 1900 && 西曆年 <= 最大西曆年; + } + + /** + * 判斷傳入的西曆月範圍是否正確。 + * + * @param 西曆月 傳入西曆月。 + * @return 傳回西曆月範圍是否正確。 + */ + public static boolean 西曆月範圍正確(final int 西曆月) { + return 西曆月 >= 1 && 西曆月 <= 12; + } + + /** + *

+ * 判斷傳入的西曆日範圍是否正確。若正確,表示傳入的西曆日和西曆月也正確。 + *

+ * + * @param 西曆年 傳入西曆年。 + * @param 西曆月 傳入西曆月。 + * @param 西曆日 傳入西曆日。 + * @return 傳回西曆年、月、日範圍是否正確。 + */ + public static boolean 西曆日範圍正確且西曆年月也正確(final int 西曆年, final int 西曆月, final int 西曆日) { + return 西曆日 >= 1 && 西曆日 <= 西曆的一個月有幾天(西曆年, 西曆月); + } + + /** + *

+ * 判斷傳入的西曆年是否為閏年。(四年閏、四百年閏、百年不閏)

+ * + * @param 西曆年 傳入西曆年。 + * @return 傳回傳入的西曆年是否為閏年。 + */ + public static boolean 西曆是閏年(final int 西曆年) { + return ((西曆年 % 4 == 0) && (西曆年 % 100 != 0) || 西曆年 % 400 == 0); //西曆閏年可被4整除但不可被100整除,或是可被400整除 + } + + /** + * 計算傳入的西曆年共有幾天。 + * + * @param 西曆年 傳入西曆年。 + * @return 傳回西曆年含有的天數。傳入數值範圍若有誤,則回傳0。 + */ + public static int 西曆一年有幾天(final int 西曆年) { + if (!西曆年範圍正確(西曆年)) { + return 0; + } + return 西曆是閏年(西曆年) ? 366 : 365; //閏年366天,非閏年365天。 + } + + /** + * 計算傳入的西曆年中的西曆月共有幾天。 + * + * @param 西曆年 傳入西曆年。 + * @param 西曆月 傳入西曆月。 + * @return 傳回西曆年中的西曆月共有幾天。傳入數值範圍若有誤,則回傳0。 + */ + public static int 西曆的一個月有幾天(final int 西曆年, final int 西曆月) { + if (!西曆年範圍正確(西曆年) || !西曆月範圍正確(西曆月)) { + return 0; + } + if (西曆月 % 2 == (西曆月 < 8 ? 1 : 0)) { + return 31; //大月31天 + } else if (西曆月 == 2) { + return 西曆是閏年(西曆年) ? 29 : 28; //閏年2月29天,非閏年2月28天 + } else { + return 30; //小月30天 + } + } + + /** + *

+ * 計算傳入的西曆年月日是該西曆年的第幾天。舉例:2013/1/4,就是第4天。

+ * + * @param 西曆年 傳入西曆年。 + * @param 西曆月 傳入西曆月。 + * @param 西曆日 傳入西曆日。 + * @return 傳回傳入的西曆年月日是該西曆年的第幾天。傳入數值範圍若有誤,則回傳0。 + */ + public static int 西曆日期是該年的第幾天(final int 西曆年, final int 西曆月, final int 西曆日) { + if (!西曆日範圍正確且西曆年月也正確(西曆年, 西曆月, 西曆日)) { + return 0; + } + int 總和天數 = 0; + for (int 月 = 1; 月 < 西曆月; 月++) { + 總和天數 += 西曆的一個月有幾天(西曆年, 月); + } + 總和天數 += 西曆日; + return 總和天數; + } + + /** + *

+ * 計算傳入的農曆年月日是該農曆年的第幾天。舉例:2013/正月/初五,就是第5天。

+ * + * @param 農曆年 傳入農曆年。 + * @param 農曆月 傳入農曆月。 + * @param 是閏月 傳入的農曆月是否為閏月。 + * @param 農曆日 傳入農曆日。 + * @return 傳回傳入的農曆年月日是該農曆年的第幾天。傳入數值範圍若有誤,則回傳0。 + */ + public static int 農曆日期是該年的第幾天(final int 農曆年, final 農曆.月 農曆月, final boolean 是閏月, final 農曆.日 農曆日) { + if (農曆日.ordinal() + 1 > 農曆的一個月有幾天(農曆年, 農曆月, 是閏月)) { //防呆 + return 0; + } + int 總和天數 = 農曆日.ordinal() + 1; + for (int 月 = 1; 月 < 農曆月.ordinal() + 1 + (是閏月 ? 1 : 0); 月++) { + 總和天數 += 農曆的一個月有幾天(農曆年, 農曆.月.values()[月 - 1], false); + } + final 農曆.月 農曆閏月 = 農曆該年的閏月月份(農曆年); + if (農曆閏月 != null) { + if (農曆月.ordinal() > 農曆閏月.ordinal()) { + 總和天數 += 農曆該年的閏月有幾天(農曆年); + } + } else if (是閏月) { //防呆 + return 0; + } + return 總和天數; + } + + /** + * 將傳入的西曆年轉成農曆對應的天干。 + * + * @param 西曆年 傳入西曆年。 + * @return 傳回傳入的西曆年所對應的天干。傳入數值範圍若有誤,則回傳null。 + */ + public static 農曆.天干 西曆年轉農曆天干(final int 西曆年) { + if (!西曆年範圍正確(西曆年)) { + return null; + } + return 農曆.天干.values()[(6 + (西曆年 - 1900)) % 農曆.天干.values().length]; + } + + /** + * 將傳入的西曆年轉成農曆對應的地支。 + * + * @param 西曆年 傳入西曆年。 + * @return 傳回傳入的西曆年所對應的地支。傳入數值範圍若有誤,則回傳null。 + */ + public static 農曆.地支 西曆年轉農曆地支(final int 西曆年) { + if (!西曆年範圍正確(西曆年)) { + return null; + } + return 農曆.地支.values()[(西曆年 - 1900) % 農曆.地支.values().length]; + } + + /** + * 將農曆的天干地支,轉換成所有可能的西曆年。 + * + * @param 農曆年天干 傳入農曆天干。 + * @param 農曆年地支 傳入農曆地支。 + * @return 以整數陣列的形式,傳回天干地支可能對應的所有西曆年。 + */ + public static int[] 農曆天干地支換算成西曆年(final 農曆.天干 農曆年天干, final 農曆.地支 農曆年地支) { + final ArrayList 西曆年清單 = new ArrayList<>(); + final 農曆.天干[] 天干 = 農曆.天干.values(); + final 農曆.地支[] 地支 = 農曆.地支.values(); + int 天干計數器 = 6; + int 地支計數器 = 0; + int 西曆年計數器 = 1900; + int 增加年數 = 1; + for (; 西曆年計數器 <= 最大西曆年; 西曆年計數器 += 增加年數) { + if (天干[天干計數器 % 天干.length] == 農曆年天干 && 地支[地支計數器 % 地支.length] == 農曆年地支) { + 增加年數 = 60; + 西曆年清單.add(西曆年計數器); + } else { + 天干計數器++; + 地支計數器++; + } + } + final int 西曆年陣列[] = new int[西曆年清單.size()]; + for (int 索引 = 0; 索引 < 西曆年陣列.length; ++索引) { + 西曆年陣列[索引] = 西曆年清單.get(索引); + } + return 西曆年陣列; + } + + /** + * 取得農曆該年的閏月月份。 + * + * @param 農曆年 傳入農曆年。 + * @return 傳回農曆該年對應的閏月月份。傳入數值範圍若有誤,則回傳null。 + */ + public static 農曆.月 農曆該年的閏月月份(final int 農曆年) { + if (!西曆年範圍正確(農曆年)) { + return null; + } + final int 月 = 閏月[(農曆年 - 1901) / 2]; + int 索引; + if (農曆年 % 2 == 1) { + 索引 = ((月 & 0xf0) >> 4) - 1; + } else { + 索引 = (月 & 0x0f) - 1; + } + if (索引 < 0) { + return null; + } else { + return 農曆.月.values()[索引 % 12]; + } + } + + /** + * 取得農曆該年的閏月有幾天。 + * + * @param 農曆年 傳入農曆年。 + * @return 傳回農曆該年對應的閏月有幾天。傳入數值範圍若有誤或是沒有閏月,則回傳0。 + */ + public static int 農曆該年的閏月有幾天(final int 農曆年) { + if (!西曆年範圍正確(農曆年)) { + return 0; + } + final 農曆.月 閏月 = 農曆該年的閏月月份(農曆年); + if (閏月 == null) { + return 0; + } + return 農曆的一個月有幾天(農曆年, 閏月, true); + } + + /** + * 計算傳入的農曆年中的農曆月共有幾天。 + * + * @param 農曆年 傳入農曆年。 + * @param 農曆月 傳入農曆月。 + * @param 是閏月 傳入的農曆月是否為閏月。 + * @return 傳回農曆年中的農曆月共有幾天。傳入數值範圍若有誤,則回傳0。 + */ + public static int 農曆的一個月有幾天(final int 農曆年, 農曆.月 農曆月, final boolean 是閏月) { + if (!西曆年範圍正確(農曆年)) { + return 0; + } + int 月 = 農曆月.ordinal() + 1; + final 農曆.月 閏月 = 農曆該年的閏月月份(農曆年); + final int 閏月值; + if (閏月 == null) { + 閏月值 = 0; + } else { + 閏月值 = 閏月.ordinal() + 1; + } + if (是閏月) { + if (月 != 閏月值) { //防呆 + return 0; + } else //此為閏月需往計算之後一個月的天數 + if ((大月[農曆年 - 1901] & (0x8000 >> 閏月值)) == 0) { + return 29; + } else { + return 30; + } + } else { + if ((閏月值 > 0) && (月 > 閏月值)) { //若今年有閏月,且該西曆月應在閏月之後再加一個月 + 月++; + } + if ((大月[農曆年 - 1901] & (0x8000 >> (月 - 1))) == 0) { + return 29; + } else { + return 30; + } + } + } + + /** + * 取得傳入的農曆年共有幾天。 + * + * @param 農曆年 傳入農曆年。 + * @return 傳回農曆年含有的天數。傳入數值範圍若有誤,則回傳0。 + */ + public static int 農曆一年有幾天(final int 農曆年) { + int 總和天數 = 0; + for (int 索引 = 0; 索引 < 12; 索引++) { + 總和天數 += 農曆的一個月有幾天(農曆年, 農曆.月.values()[索引], false); + } + 總和天數 += 農曆該年的閏月有幾天(農曆年); + return 總和天數; + } + + /** + * 傳入出生年月日和出生時辰(生辰八字),計算此八字有幾兩重。 + * + * @param 出生年月日 傳入此農曆類別的出生年月日。 + * @param 出生時辰 + *

+ * 傳入以地支表示的出生時辰。(子:23~1、丑:1~3、寅:3~5、卯:5~7、辰:7~9、巳:9~11、午:11~13、未:13~15、申:15~17、酉:17~19、戌:19~21、亥:21~23) + *

+ * @return 傳回八字計算之後的重量(單位:兩)。 + */ + public static float 計算八字有幾兩重(final 農曆 出生年月日, final 農曆.地支 出生時辰) { + int 總和重量 = 0; + int 年計數器 = 0, 天干計數器 = 0, 地支計數器 = 0; + while (!(天干.values()[(天干計數器++) % 天干.values().length] == 出生年月日.取得天干() & 地支.values()[(地支計數器++) % 地支.values().length] == 出生年月日.取得地支())) { + 年計數器++; + } + 總和重量 += 年八字重量[年計數器]; + 總和重量 += 月八字重量[出生年月日.取得農曆月().ordinal()]; + 總和重量 += 日八字重量[出生年月日.取得農曆日().ordinal()]; + 總和重量 += 時辰八字重量[出生時辰.ordinal()]; + return 總和重量 / 10.0f; + } + + /** + * 傳入出生年月日和出生時辰(生辰八字),計算此八字有幾兩重。 + * + * @param 出生年月日 傳入此農曆類別的出生年月日。 + * @param 時間 傳入時間 + * @return 傳回八字計算之後的重量(單位:兩)。 + */ + public static float 計算八字有幾兩重(final 農曆 出生年月日, final LocalTime 時間) { + return 計算八字有幾兩重(出生年月日, 時辰地支(時間)); + } + + /** + *

+ * 建立農曆的類別方法。傳入西曆年、月、日。

+ * + * @param 西曆年 傳入西曆年。 + * @param 西曆月 傳入西曆月。 + * @param 西曆日 傳入西曆日。 + * @return 傳回建立出來的農曆實體。 + */ + public static 農曆 建立(final int 西曆年, final int 西曆月, final int 西曆日) { + if (!西曆日範圍正確且西曆年月也正確(西曆年, 西曆月, 西曆日)) { + return null; + } + final 農曆 o = new 農曆(); + return o.讀入西曆(西曆年, 西曆月, 西曆日) ? o : null; + } + + /** + *

+ * 建立農曆的類別方法。傳入農曆年、月、日。

+ * + * @param 農曆年 傳入農曆年。 + * @param 農曆月 傳入農曆月。 + * @param 是閏月 傳入的農曆月是否為閏月。 + * @param 農曆日 傳入農曆日。 + * @return 傳回建立出來的農曆實體。 + */ + public static 農曆 建立(final int 農曆年, final 農曆.月 農曆月, final boolean 是閏月, final 農曆.日 農曆日) { + if (!西曆年範圍正確(農曆年)) { + return null; + } + final 農曆 o = new 農曆(); + return o.讀入農曆(農曆年, 農曆月, 是閏月, 農曆日) ? o : null; + } + + /** + *

+ * 將時間轉成對應的地支。 + *

+ * + * @param 時間 傳入時間 + * @return 傳回時間對應的地支 + */ + public static 農曆.地支 時辰地支(final LocalTime 時間) { + final int 地支值 = ((時間.getHour() + 1) % 24) / 2; + return 地支.values()[地支值]; + } + + // -----物件變數----- + private 農曆.天干 農曆年天干; + private 農曆.地支 農曆年地支; + private 農曆.月 農曆月; + private 農曆.日 農曆日; + private boolean 是閏月; + private int 西曆年, 西曆月, 西曆日, 農曆年; + + // -----建構子----- + /** + * 私有建構子,無法被外部類別使用,使這個類別無法被實體化。 + */ + private 農曆() { //禁止外部類別直接使用建構子建構物件 + } + + // -----物件方法----- + /** + * 取得西曆年。 + * + * @return 傳回西曆年。 + */ + public int 取得西曆年() { + return 西曆年; + } + + /** + * 取得西曆月。 + * + * @return 傳回西曆月。 + */ + public int 取得西曆月() { + return 西曆月; + } + + /** + * 取得西曆日。 + * + * @return 傳回西曆日。 + */ + public int 取得西曆日() { + return 西曆日; + } + + /** + * 取得農曆年。 + * + * @return 傳回農曆年。 + */ + public int 取得農曆年() { + return 農曆年; + } + + /** + * 取得農曆年對應的天干。 + * + * @return 傳回天干。 + */ + public 農曆.天干 取得天干() { + return 農曆年天干; + } + + /** + * 取得農曆年對應的地支。 + * + * @return 傳回地支。 + */ + public 農曆.地支 取得地支() { + return 農曆年地支; + } + + /** + * 取得農曆月。 + * + * @return 傳回農曆月。 + */ + public 農曆.月 取得農曆月() { + return 農曆月; + } + + /** + * 取得農曆日。 + * + * @return 傳回農曆日。 + */ + public 農曆.日 取得農曆日() { + return 農曆日; + } + + /** + * 判斷農曆月是否為閏月。 + * + * @return 傳回農曆月是否為閏月。 + */ + public boolean 是否為閏月() { + return 是閏月; + } + + /** + * 取得農曆年對應的生肖。 + * + * @return 傳回生肖。 + */ + public 農曆.生肖 取得生肖() { + return 農曆.生肖.values()[取得地支().ordinal()]; //生肖順序就是地支順序。 + } + + /** + * 傳入出生時辰,和此物件本身的年月日湊成完整的八字,計算八字重量。 + * + * @param 出生時辰 + *

+ * 傳入以地支表示的出生時辰。(子:23~1、丑:1~3、寅:3~5、卯:5~7、辰:7~9、巳:9~11、午:11~13、未:13~15、申:15~17、酉:17~19、戌:19~21、亥:21~23)

+ * @return 傳回八字計算之後的重量(單位:兩)。 + */ + public float 計算八字有幾兩重(final 農曆.地支 出生時辰) { + return 計算八字有幾兩重(this, 出生時辰); + } + + /** + * 傳入出生時辰,和此物件本身的年月日湊成完整的八字,計算八字重量。 + * + * @param 時間 傳入時間 + * @return 傳回八字計算之後的重量(單位:兩)。 + */ + public float 計算八字有幾兩重(final LocalTime 時間) { + return 計算八字有幾兩重(this, 時辰地支(時間)); + } + + /** + *

+ * 私有方法。以西曆計算農曆並創建農曆。

+ * + * @param 西曆年 傳入西曆年。 + * @param 西曆月 傳入西曆月。 + * @param 西曆日 傳入西曆日。 + * @return 傳回農曆是否建立成功。 + */ + private boolean 讀入西曆(final int 西曆年, final int 西曆月, final int 西曆日) { + int 農曆年, 農曆月, 農曆日; + int 天數差距 = 西曆日期是該年的第幾天(西曆年, 西曆月, 西曆日) - 1; + 農曆.月 暫存農曆月 = 農曆該年的閏月月份(西曆年); + int 農曆閏月 = ((暫存農曆月 != null) ? 暫存農曆月.ordinal() + 1 : 0); + + //天數差距目前存的是西曆日期與該西曆年第一天(新年)的天數差距 + if (天數差距 < 新年偏差[西曆年 - 1901]) { //若天數差距比「西曆新年與對應農曆年新年」之天數差距小,表示此西曆日期尚未進入下一個農曆年(尚未摸到正月,還在農曆年尾) + 暫存農曆月 = 農曆該年的閏月月份(西曆年 - 1); + 農曆閏月 = ((暫存農曆月 != null) ? 暫存農曆月.ordinal() + 1 : 0); + + 農曆年 = 西曆年 - 1; //農曆年必須對應去年西曆年 + if (農曆年 < 1901) { //若年份超出範圍 + return false; //讀入失敗 + } + 天數差距 = 新年偏差[西曆年 - 1901] - 天數差距; //此時天數差距為此西曆日期到該西曆年應該對應的農曆年新年之差距天數(若西曆日期為2/3,農曆新年對應的西曆日期為2/10,則兩天數差距為40-(30+3)=7) + 農曆月 = 12; + while (true) { + if (農曆閏月 == 農曆月) { + int 農曆閏月天數 = 農曆該年的閏月有幾天(農曆年); + if (天數差距 > 農曆閏月天數) { + 天數差距 -= 農曆閏月天數; + } else { + 是閏月 = true; + } + } + int 農曆月天數 = 農曆的一個月有幾天(農曆年, 農曆.月.values()[農曆月 - 1], false); + if (天數差距 > 農曆月天數) { + 天數差距 -= 農曆月天數; + 是閏月 = false; + 農曆月--; + } else { + break; + } + } + if (天數差距 == 0) { + 農曆日 = 1; + 農曆月++; + } else { + 農曆日 = 農曆的一個月有幾天(農曆年, 農曆.月.values()[農曆月 - 1], 是閏月) - 天數差距 + 1; + } + } else { //若天數差距沒比「西曆新年與對應農曆年新年」之天數差距小,表示此西曆日期已經進入下一個農曆年(已摸到正月,從在農曆年頭開始) + 農曆年 = 西曆年; //農曆年就是西曆年 + 天數差距 -= 新年偏差[西曆年 - 1901]; //此時天數差距為西曆日期與對應農曆年第一天之距離(若西曆日期為2/23(此時天數差距為53),而對應農曆年第一天是西曆的2/10(新年偏差為40),則這兩個日期的天數差距為53-40=13) + 農曆月 = 1; + while (true) { + int 農曆月天數 = 農曆的一個月有幾天(農曆年, 農曆.月.values()[農曆月 - 1], false); + + if (天數差距 >= 農曆月天數) { + 天數差距 -= 農曆月天數; + if (農曆閏月 == 農曆月) { + int 農曆閏月天數 = 農曆該年的閏月有幾天(西曆年); + if (天數差距 >= 農曆閏月天數) { + 天數差距 -= 農曆閏月天數; + } else { + 是閏月 = true; + break; + } + } + 農曆月++; + } else { + break; + } + } + 農曆日 = 天數差距 + 1; + } + this.西曆年 = 西曆年; + this.西曆月 = 西曆月; + this.西曆日 = 西曆日; + this.農曆年 = 農曆年; + this.農曆年天干 = 西曆年轉農曆天干(農曆年); + this.農曆年地支 = 西曆年轉農曆地支(農曆年); + this.農曆月 = 農曆.月.values()[農曆月 - 1]; + this.農曆日 = 農曆.日.values()[農曆日 - 1]; + + return true; + } + + /** + *

+ * 私有方法。以農曆計算西曆並創建農曆。

+ * + * @param 農曆年 傳入農曆年。 + * @param 農曆月 傳入農曆月。 + * @param 是閏月 傳入的農曆月是否為閏月。 + * @param 農曆日 取得農曆日。 + * @return 傳回農曆是否建立成功。 + */ + private boolean 讀入農曆(final int 農曆年, final 農曆.月 農曆月, final boolean 是閏月, final 農曆.日 農曆日) { + int 西曆年, 西曆月, 西曆日; + int 農曆第幾天 = 農曆日期是該年的第幾天(農曆年, 農曆月, 是閏月, 農曆日); + if (農曆第幾天 == 0) { + return false; + } + int 天數差距 = 農曆第幾天 - 1 + 新年偏差[農曆年 - 1901]; //天數差距為該農曆日期與對應西曆年新年的天數差距。其實就是轉換成西曆日期後,西曆日期與新年的距離。(舉例,農曆2012/1/3,為第3天,和農曆新年差了2天。加上西曆農曆偏差52天。因此天數差距為54) + int 西曆年天數 = 西曆一年有幾天(農曆年); + if (天數差距 >= 西曆年天數) { + 天數差距 -= 西曆年天數; + 西曆年 = 農曆年 + 1; + } else { + 西曆年 = 農曆年; + } + for (西曆月 = 1; 天數差距 >= 西曆的一個月有幾天(西曆年, 西曆月); 西曆月++) { + 天數差距 -= 西曆的一個月有幾天(西曆年, 西曆月); + } + 西曆日 = 天數差距 + 1; + + this.西曆年 = 西曆年; + this.西曆月 = 西曆月; + this.西曆日 = 西曆日; + this.農曆年 = 農曆年; + this.農曆年天干 = 西曆年轉農曆天干(農曆年); + this.農曆年地支 = 西曆年轉農曆地支(農曆年); + this.農曆月 = 農曆月; + this.農曆日 = 農曆日; + this.是閏月 = 是閏月; + return true; + } + + /** + * 取得農曆字串。 + * + * @return 傳回農曆字串。 + */ + public String 取得農曆() { + return String.format("%d(%s%s、%s年) %s%s %s", 取得農曆年(), 取得天干(), 取得地支(), 取得生肖(), 取得農曆月(), 是否為閏月() ? "(閏)" : "", 取得農曆日()); + } + + /** + * 取得西曆字串。 + * + * @return 傳回西曆字串。 + */ + public String 取得西曆() { + return String.format("%d-%d-%d", 取得西曆年(), 取得西曆月(), 取得西曆日()); + } + + /** + *

+ * 取得物件字串。包含著西曆與農曆的年月日

+ * + * @return 傳回物件字串。 + */ + @Override + public String toString() { + return String.format("西曆:%s%n農曆:%s", 取得西曆(), 取得農曆()); + } + + /** + * 判斷兩農曆物件是否相同。 + * + * @param 物件 傳入物件。 + * @return 傳回兩農曆物件是否相同(西曆農曆日期相同)。 + */ + @Override + public boolean equals(final Object 物件) { + if (物件 == null) { + return false; + } + if (物件 instanceof 農曆) { + return this.hashCode() == 物件.hashCode(); + } + return false; + } + + /** + * 計算並取得農曆的雜湊值。 + * + * @return 傳回農曆的雜湊值。 + */ + @Override + public int hashCode() { + int 雜湊 = 7; + 雜湊 = 61 * 雜湊 + this.農曆月.hashCode(); + 雜湊 = 61 * 雜湊 + this.農曆日.hashCode(); + 雜湊 = 61 * 雜湊 + (this.是閏月 ? 1 : 0); + 雜湊 = 61 * 雜湊 + this.西曆年; + 雜湊 = 61 * 雜湊 + this.西曆月; + 雜湊 = 61 * 雜湊 + this.西曆日; + 雜湊 = 61 * 雜湊 + this.農曆年; + return 雜湊; + } +}