随笔-144  评论-80  文章-1  trackbacks-0

List list = new Vector();
    AnnuityStruct annuityStruct = null;
   
 for(int i = 0; i < recordCount.length; i++)
 {intCount = CCStrTools.str2Int(recordCount[i]);
  annuityStruct = PayoutObjectPool.getInstance().getAnnuityInstance();
  annuityStruct.init();
  annuityStruct.setAnnuitySeq(annuitySeq[intCount]);
  annuityStruct.setAnnuityPerson(Double.parseDouble(annuityPerson[intCount]));
  annuityStruct.setAnnuityAppPerson(Double.parseDouble(annuityAppPerson[intCount]));
  annuityStruct.setAnnuityCom(Double.parseDouble(annuityCom[intCount]));
  annuityStruct.setAnnuityAppCom(Double.parseDouble(annuityAppCom[intCount]));
  list.add(annuityStruct.clone());
 }




/**
  *PayoutObjectPool构造器
  */
 private PayoutObjectPool() {
  System.out.println("PayoutObjectPool create.");
 }

 /**
  *获取PayoutObjectPool实例
  *@return PayoutObjectPool 对象实例
  */
 public static synchronized PayoutObjectPool getInstance() {
  if (pool == null)
   pool = new PayoutObjectPool();
  return pool;
 }


/**
  *获取AnnuityStruct实例
  *@return AnnuityStruct 对象实例
  */
 public AnnuityStruct getAnnuityInstance() {
  if (annuityStruct == null)
   annuityStruct = new AnnuityStruct();
  return (AnnuityStruct) annuityStruct.clone();
 }



List里面放的都是引用~

posted on 2005-03-30 21:39 小力力力 阅读(314) 评论(0)  编辑  收藏 所属分类: JAVA

只有注册用户登录后才能发表评论。


网站导航: