for循环输出12星座JAVA
import java.util.Map;
1.import java.util.HashMap;
2.import java.util.ArrayList;
3.import java.util.List;
4.
5.//import android.util.Log;
6.
7.public class XingZuo {
8. private static List<Map<String, Object>> LIST = null;
9. private static float[][] floatXingZuo = null;
10.
11. public XingZuo() {
12. // LIST=loadXingZuo12();
13. // floatXingZuo=loadXingZuoFloatValue();
14. }
15.
16. public static String getXingZuoName(int month, int day) {
17. if (floatXingZuo == null)
18. floatXingZuo = loadXingZuoFloatValue();
19.
20. String ds = String.format("%02d", day);
21. float target = Float.valueOf(month + "." + ds);
22.
23. boolean bool1 = Floatpare(target, 12.22f) >= 0 ? true : false;
24. boolean bool2 = Floatpare(target, 1.20f) <= 0 ? true : false;
25. if (bool1 || bool2) {
26. return "摩羯座";
27. }
28.
29. int i;
30. boolean b1, b2;
31. for (i = 0; i < 12; i++) {
32.
33. b1 = Floatpare(target, floatXingZuo[0][i]) >= 0 ? true : false;
34. b2 = Floatpare(target, floatXingZuo[1][i]) <= 0 ? true : false;
35.
36. if (b1 && b2)
37. break;
38. }
39.
40. Map map = (Map) ((i));
41.
42. ("XINGZUO_NAME") + "";
43. }
44.
45. private static float[][] loadXingZuoFloatValue() {
46. if (LIST == null)
47. LIST = loadXingZuo12();
48.
49. Map map = null;
50. // String xzname=null;
51. int mind, maxd, minm, maxm;
52.
53. float[][] fxingzuo = new float[2][12];
54.
55. float start, end;
56. for (int i = 0; i < 12; i++) {
57. map = (Map) ((i));
58.
59. mind = Integer.("MIN_DAY") + "");
60. maxd = Integer.("MAX_DAY") + "");
61. minm = Integer.("MIN_MONTH") + "");
62. maxm = Integer.("MAX_MONTH") + "");
63.
64. start = Float.valueOf(minm + "." + mind);
65. end = Float.valueOf(maxm + "." + maxd);
66.
67. fxingzuo[0][i] = start;
68. fxingzuo[1][i] = end;
69. }
70.
java valueof71. return fxingzuo;
72. }
73.
74. private static List loadXingZuo12() {
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论