01: package fri.util.collections;
02:
03: import java.util.List;
04:
05: /**
06: A hashtable that holds a list of unique values instead of a single value for one key.
07:
08: @author Fritz Ritzberger
09: */
10:
11: public class UniqueAggregatingHashtable extends AggregatingHashtable {
12: public UniqueAggregatingHashtable() {
13: super ();
14: }
15:
16: public UniqueAggregatingHashtable(int initialCapacity) {
17: super (initialCapacity);
18: }
19:
20: protected boolean shouldAdd(List list, Object value) {
21: return list != null ? list.indexOf(value) < 0 : true;
22: }
23:
24: }
|