锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲精品不卡,亚洲色图校园春色,亚洲一区观看http://www.aygfsteel.com/stevenjohn/category/52529.html閭d簺闈掓槬鐨勫瞾鏈?/description>zh-cnSun, 02 Sep 2012 19:50:17 GMTSun, 02 Sep 2012 19:50:17 GMT60Java enum鍜屾柟娉曞唴閮ㄧ被http://www.aygfsteel.com/stevenjohn/archive/2012/09/02/386807.htmlabinabinSun, 02 Sep 2012 10:00:00 GMThttp://www.aygfsteel.com/stevenjohn/archive/2012/09/02/386807.htmlhttp://www.aygfsteel.com/stevenjohn/comments/386807.htmlhttp://www.aygfsteel.com/stevenjohn/archive/2012/09/02/386807.html#Feedback0http://www.aygfsteel.com/stevenjohn/comments/commentRss/386807.htmlhttp://www.aygfsteel.com/stevenjohn/services/trackbacks/386807.htmlpackage com.abin.lee.collection.inner;
public class XiXiang {
public static enum IdType{
ONE("one"),TWO("two"),THREE("three");
private String textVal;
private IdType(String textVal){
this.textVal=textVal;
}
private String getString(){
return textVal;
}
}
public static String get(IdType type,String id){
String status=null;
final class get{
String result=null;
public String getName(String id){
if(id.equals("1")){
result="lee";
}
return result;
}
}
if(type==IdType.valueOf("ONE")){
status=new get().getName(id);
}
return status;
}
public static void main(String[] args) {
String id="1";
IdType type=IdType.valueOf("ONE");
String result=new XiXiang().get(type,id);
System.out.println("result="+result);
}
}


abin 2012-09-02 18:00 鍙戣〃璇勮
]]>
Java Stirng鍜宔num鐩鎬簰杞寲http://www.aygfsteel.com/stevenjohn/archive/2012/09/02/386796.htmlabinabinSun, 02 Sep 2012 07:46:00 GMThttp://www.aygfsteel.com/stevenjohn/archive/2012/09/02/386796.htmlhttp://www.aygfsteel.com/stevenjohn/comments/386796.htmlhttp://www.aygfsteel.com/stevenjohn/archive/2012/09/02/386796.html#Feedback0http://www.aygfsteel.com/stevenjohn/comments/commentRss/386796.htmlhttp://www.aygfsteel.com/stevenjohn/services/trackbacks/386796.htmlpackage com.abin.lee.collection.enumer;
public class ChangeType {
public static enum stype{
CHINA("china"),JAPAN("japan"),GERMAN("german");
private String textVal;
private stype(String textVal){
this.textVal=textVal;
}
public String toString(){
return textVal;
}
}
public static void main(String[] args) {
String abin=stype.CHINA.toString();
System.out.println(abin);
stype abing=stype.valueOf("CHINA");//娉ㄦ剰榪欓噷涓嶅簲璇ヤ紶china銆乯apan銆乬erman錛屽繀欏諱紶CHINA,JAPAN,GERMAN
System.out.println("abing="+abing);
}
}


abin 2012-09-02 15:46 鍙戣〃璇勮
]]>
Java 闈欐佸唴閮ㄧ被鍜屾灇涓?閾惰仈鏀粯)http://www.aygfsteel.com/stevenjohn/archive/2012/09/02/386776.htmlabinabinSat, 01 Sep 2012 16:03:00 GMThttp://www.aygfsteel.com/stevenjohn/archive/2012/09/02/386776.htmlhttp://www.aygfsteel.com/stevenjohn/comments/386776.htmlhttp://www.aygfsteel.com/stevenjohn/archive/2012/09/02/386776.html#Feedback0http://www.aygfsteel.com/stevenjohn/comments/commentRss/386776.htmlhttp://www.aygfsteel.com/stevenjohn/services/trackbacks/386776.html//榪欓噷闈富瑕佹槸鐢變簬閾惰仈鐨勬墜鏈烘敮浠樼敤鍒頒簡涓涓粯?gòu)苿勮浆鎹㈡柟寮忛棶棰樺Q屽綋璋冪敤鏀粯瀹濅粯?gòu)苿勬椂鍊欙紝姣斿涓鍒嗛挶鏍煎紡灝辨槸鎴戜滑鏅氱敤鐨勬牸寮忥細0.01錛岃岄摱鑱旂‘瑕佹妸鏍煎紡杞寲涓?00000000001錛堥摱鑱旇姹傛槸12浣嶏級榪欑鏍煎紡鐨勶紝鏈鍚庝竴浣嶆槸鍒嗭紝鐒跺悗鍚戝墠渚濇鏄錛屽厓錛屽崄鍏冿紝鐧懼厓錛岀浉淇′笉鐢ㄦ垜璇達紝浣犲凡緇忔噦浜嗗惂銆傛墍浠ヨ繖閲屽氨闇瑕佷竴涓漿鎹紝涓轟簡搴斿鍍?000錛?000.00錛?000.0榪欑浼犺繃鏉ョ殑鏍煎紡鐨勬暟鎹紝鐗瑰仛涓涓嬭漿鎹紝鐒跺悗浼犵粰閾惰仈榪涜鏀粯銆?br />

package com.abin.lee.collection.inner;
public class ConsumeFinance {
public static enum Currency{
CHINARMB("chinarmb"),DOLLAR("dollar"),HK("hk");
private Currency(String textVal){
this.textVal=textVal;
}
private String textVal;
public String toString(){
return textVal;
}
}
public static String ConsumeProcess(String money,Currency currency){
System.out.println("currentcy="+currency);
String flag=null;
if(currency.equals(Currency.CHINARMB)){
ConsumeFinance.ChinaProcess chinaProcess=new ConsumeFinance.ChinaProcess();
flag=chinaProcess.chinaChange(money, currency);
}
return flag;
public static String ConsumeProcessReturn(String money,Currency currency){
System.out.println("currentcy="+currency);
String flag=null;
if(currency.equals(Currency.CHINARMB)){
ConsumeFinance.ChinaReturn chinaReturn=new ConsumeFinance.ChinaReturn();
flag=chinaReturn.chinaReChange(money, currency);
}
return flag;
public static class ChinaProcess{
private static String status=null;
public static String chinaChange(String money,Currency currency){
int point=money.lastIndexOf(".");
if(point==-1){
StringBuffer stb=new StringBuffer();
int len=money.length();
int lon=10-len;
for(int i=0;i<lon;i++){
stb.append("0");
}
stb.append(money);
stb.append("00");
status=stb.toString().intern();
}
if(point>0){
int len=money.indexOf(".");
int chn=money.length()-len-1;
switch(chn){
//鍏堝垽鏂璵oney鏍煎紡涓?00.0榪欑鏍煎紡鐨勶紝灝忔暟鐐瑰悗闈㈡湁涓浣嶅皬鏁扮偣鐨勬儏鍐?/div>
case  1:
StringBuffer stb=new StringBuffer(money);
stb.deleteCharAt(len);
int lend=stb.length();
StringBuffer sb=new StringBuffer();
for(int i=0;i<12-lend;i++){
sb.append("0");
}
sb.append(stb.toString());
status=sb.toString().intern();
//鍏堝垽鏂璵oney鏍煎紡涓?00.01榪欑鏍煎紡鐨勶紝灝忔暟鐐瑰悗闈㈡湁涓や綅灝忔暟鐐圭殑鎯呭喌
case 2:
money=money.replace(".", "");
int lende=money.length();
String connect="";
for(int i=0;i<12-lende;i++){
connect+="0";
}
status=connect+money;
}
}
return status;
}
}
//鎶?00000001001杞寲涓?0.01榪欑鏍煎紡
public static class ChinaReturn{
private static String status=null;
public static String chinaReChange(String money,Currency currency){
int change=money.length();
int num=0;
for(int i=0;i<change;i++){
int value=Integer.valueOf(String.valueOf(money.charAt(i)));
if(value>0){
num=i;
break;
}
}
money=money.substring(num);
if(num==10){
status="0."+money;
}
if(num==11){
status="0.0"+money;
}
if(num<10){
System.out.println(money.length());
StringBuffer stb=new StringBuffer(money);
stb.insert(money.length()-2, ".");
status=stb.toString().intern();
}
return status;
}
}
public static void main(String[] args) {
Currency currency=Currency.CHINARMB;
String money="000000001001";
String result=ConsumeProcessReturn(money, currency);
// String result=ConsumeProcess(money, currency);
System.out.println("result="+result);
}
}


abin 2012-09-02 00:03 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 周宁县| 佛山市| 阿鲁科尔沁旗| 阳新县| 上栗县| 昌平区| 吴旗县| 普兰店市| 甘泉县| 博客| 甘肃省| 东乌| 岚皋县| 吉木乃县| 澄城县| 云阳县| 夏邑县| 鱼台县| 汕尾市| 开封市| 明水县| 白河县| 南川市| 宜兴市| 泽库县| 滕州市| 华池县| 灵宝市| 边坝县| 太仓市| 田东县| 通州区| 穆棱市| 万宁市| 莫力| 西乌珠穆沁旗| 内江市| 北碚区| 长武县| 玛沁县| 镇原县|