posts - 14,  comments - 37,  trackbacks - 0
 // 内部类定义一个比较器
 
public class ContentComparator implements Comparator {
  
public int compare(Object o1, Object o2) {
   MedicineCountForm c1 
= (MedicineCountForm)o1;
   MedicineCountForm c2 
= (MedicineCountForm)o2;
   String tm1 
= String.valueOf(c1.getCount());
   String tm2 
= String.valueOf(c2.getCount());
   
if (Integer.parseInt(tm1) > Integer.parseInt(tm2))
    
return -1;
   
else if (Integer.parseInt(tm1) < Integer.parseInt(tm2))
    
return 1;
   
else
    
return 0;
  }

 }
posted on 2008-01-02 10:30 冰封的爱 阅读(604) 评论(0)  编辑  收藏 所属分类: J2EE

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


网站导航:
 
<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

常用链接

留言簿(3)

随笔档案

文章分类

文章档案

相册

搜索

  •  

最新评论

阅读排行榜

评论排行榜