锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲午夜福利在线观看,亚洲a级在线观看,亚洲精品福利网泷泽萝拉http://www.tkk7.com/mstar/category/1573.html鎼炶蔣浠跺紑鍙戝氨鍍忚寮哄ジ,濡傛灉涓嶈兘鍙嶆姉,灝變韓鍙楀畠鍚э紒zh-cnTue, 27 Feb 2007 18:20:00 GMTTue, 27 Feb 2007 18:20:00 GMT60- org.mstar.collection.TwoDimensionTablehttp://www.tkk7.com/mstar/archive/2005/06/01/5434.html榛戠伒榛戠伒Wed, 01 Jun 2005 15:12:00 GMThttp://www.tkk7.com/mstar/archive/2005/06/01/5434.htmlhttp://www.tkk7.com/mstar/comments/5434.htmlhttp://www.tkk7.com/mstar/archive/2005/06/01/5434.html#Feedback1http://www.tkk7.com/mstar/comments/commentRss/5434.htmlhttp://www.tkk7.com/mstar/services/trackbacks/5434.html闃呰鍏ㄦ枃

]]> - org.mstar.collection.Counterhttp://www.tkk7.com/mstar/archive/2005/06/01/5432.html榛戠伒榛戠伒Wed, 01 Jun 2005 13:11:00 GMThttp://www.tkk7.com/mstar/archive/2005/06/01/5432.htmlhttp://www.tkk7.com/mstar/comments/5432.htmlhttp://www.tkk7.com/mstar/archive/2005/06/01/5432.html#Feedback0http://www.tkk7.com/mstar/comments/commentRss/5432.htmlhttp://www.tkk7.com/mstar/services/trackbacks/5432.html榪欎釜綾諱富瑕佸姛鑳芥槸璁板綍鏀懼叆鍏朵腑鐨勭浉鍚屽璞$殑涓暟錛堢敤equals()姣旇緝錛?BR>
渚嬪錛?BR>
Counter c = new Counter();
c.add("One");
c.add("Two");
c.add("One");

c.get("One") // Result is 2;
c.get("Two") // Result is 1;
榪欎釜綾葷殑鍚嶅瓧涔熻闇瑕佽浠ヤ笅銆?BR>榪樻湁浠涔堥渶瑕佹敼榪涚殑鍦版柟錛屾垨鑰呰繕闇瑕佸摢浜涙柟娉曪紝璇峰ぇ瀹舵彁紺恒?BR>
瀹炵幇濡備笅錛?BR>
1
package org.mstar.collection;
2
3
import java.util.HashMap;
4
import java.util.Iterator;
5
import java.util.Map;
6
7
8
/**//**
9
* @author mty
10
*
11
*/
12
public class Counter
{
13
private Map map;
14
15
public Counter()
{
16
map = new HashMap();
17
}
18
19
public void add(Object key)
{
20
if(map.containsKey(key))
{
21
Integer i = (Integer)map.get(key);
22
int amount = i.intValue();
23
map.put(key,new Integer(++amount));
24
}else
{
25
map.put(key,new Integer(1));
26
}
27
}
28
29
public void add(Object key,int amount)
{
30
if(map.containsKey(key))
{
31
Integer i = (Integer)map.get(key);
32
int amount2 = i.intValue();
33
map.put(key,new Integer(amount+amount2));
34
}else
{
35
map.put(key,new Integer(amount));
36
}
37
}
38
39
public Iterator iterator()
{
40
return map.keySet().iterator();
41
}
42
43
public int getCount(Object key)
{
44
Integer i = (Integer)map.get(key);
45
return i.intValue();
46
}
47
48
public int[] countArray()
{
49
int[] result = new int[map.size()];
50
Object[] keys = keyArray();
51
for(int i=0;i<result.length;i++)
{
52
result[i] = getCount(keys[i]);
53
}
54
55
return result;
56
}
57
58
public Object[] keyArray()
{
59
return map.keySet().toArray();
60
}
61
62
public void remove(Object key)
{
63
if(map.containsKey(key))
{
64
Integer i = (Integer)map.get(key);
65
int amount = i.intValue();
66
map.put(key,new Integer(amount<0?0:--amount));
67
}
68
}
69
70
public void remove(Object key,int amount)
{
71
if(map.containsKey(key))
{
72
Integer i = (Integer)map.get(key);
73
int amount2 = i.intValue();
74
map.put(key,new Integer(amount2-amount<0?0:amount2-amount));
75
}
76
}
77
78
public int size()
{
79
return map.size();
80
}
81
}

]]>
主站蜘蛛池模板:
在线毛片片免费观看|
亚洲爆乳少妇无码激情|
a毛看片免费观看视频|
亚洲av无码乱码在线观看野外
|
狠狠热精品免费观看|
日韩免费在线观看|
亚洲精品av无码喷奶水糖心|
妞干网免费视频在线观看|
亚洲无码一区二区三区|
天天摸天天操免费播放小视频|
亚洲欧洲国产综合AV无码久久|
毛片a级三毛片免费播放|
亚洲欧洲日韩极速播放|
女人18毛片水真多免费播放|
亚洲AV日韩AV无码污污网站|
亚洲äv永久无码精品天堂久久
|
亚洲高清在线观看|
无码囯产精品一区二区免费
|
亚洲狠狠爱综合影院婷婷|
四虎精品免费永久免费视频|
国产成人综合亚洲AV第一页|
亚欧免费无码aⅴ在线观看|
亚洲成A∨人片在线观看无码|
天天操夜夜操免费视频|
阿v视频免费在线观看|
亚洲精品无码专区在线在线播放|
久久久久久AV无码免费网站下载|
91亚洲视频在线观看|
国产在线98福利播放视频免费|
九九免费观看全部免费视频|
亚洲三级电影网址|
成年女人午夜毛片免费看|
人人爽人人爽人人片av免费|
亚洲免费在线播放|
永久黄网站色视频免费直播|
中文字幕成人免费高清在线视频|
亚洲第一成年人网站|
亚洲福利精品电影在线观看|
无码人妻丰满熟妇区免费|
亚洲成av人在线观看网站|
国产成人亚洲综合无码精品
|