修改获取星座的方法名
This commit is contained in:
@@ -174,6 +174,7 @@ public class Solar{
|
||||
* 获取星座
|
||||
*
|
||||
* @return 星座
|
||||
* @deprecated 使用getXingZuo
|
||||
*/
|
||||
public String getXingzuo(){
|
||||
int index = 11,m = month,d = day;
|
||||
@@ -204,6 +205,40 @@ public class Solar{
|
||||
return SolarUtil.XINGZUO[index];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取星座
|
||||
*
|
||||
* @return 星座
|
||||
*/
|
||||
public String getXingZuo(){
|
||||
int index = 11,m = month,d = day;
|
||||
int y = m*100+d;
|
||||
if(y>=321&&y<=419){
|
||||
index = 0;
|
||||
}else if(y>=420&&y<=520){
|
||||
index = 1;
|
||||
}else if(y>=521&&y<=620){
|
||||
index = 2;
|
||||
}else if(y>=621&&y<=722){
|
||||
index = 3;
|
||||
}else if(y>=723&&y<=822){
|
||||
index = 4;
|
||||
}else if(y>=823&&y<=922){
|
||||
index = 5;
|
||||
}else if(y>=923&&y<=1022){
|
||||
index = 6;
|
||||
}else if(y>=1023&&y<=1121){
|
||||
index = 7;
|
||||
}else if(y>=1122&&y<=1221){
|
||||
index = 8;
|
||||
}else if(y>=1222||y<=119){
|
||||
index = 9;
|
||||
}else if(y<=218){
|
||||
index = 10;
|
||||
}
|
||||
return SolarUtil.XINGZUO[index];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取年份
|
||||
*
|
||||
@@ -274,7 +309,7 @@ public class Solar{
|
||||
s.append(")");
|
||||
}
|
||||
s.append(" ");
|
||||
s.append(getXingzuo());
|
||||
s.append(getXingZuo());
|
||||
s.append("座");
|
||||
return s.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user