KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fri > util > collections > UniqueAggregatingHashtable


1 package fri.util.collections;
2
3 import java.util.List JavaDoc;
4
5 /**
6     A hashtable that holds a list of unique values instead of a single value for one key.
7
8     @author Fritz Ritzberger
9 */

10
11 public class UniqueAggregatingHashtable extends AggregatingHashtable
12 {
13     public UniqueAggregatingHashtable() {
14         super();
15     }
16     
17     public UniqueAggregatingHashtable(int initialCapacity) {
18         super(initialCapacity);
19     }
20     
21     protected boolean shouldAdd(List JavaDoc list, Object JavaDoc value) {
22         return list != null ? list.indexOf(value) < 0 : true;
23     }
24
25 }
26
Popular Tags