81 |
protected class TransientDB implements DB { |
protected class TransientDB implements DB { |
82 |
protected Map mappings = new HashMap(); |
protected Map mappings = new HashMap(); |
83 |
|
|
84 |
protected Set getSet(byte[] key) { |
protected Set getSet(String key) { |
85 |
ByteArrayKey k = new ByteArrayKey(key); |
Set s = (Set)mappings.get(key); |
|
Set s = (Set)mappings.get(k); |
|
86 |
if(s == null) { |
if(s == null) { |
87 |
s = new HashSet(); |
s = new HashSet(); |
88 |
mappings.put(k, s); |
mappings.put(key, s); |
89 |
} |
} |
90 |
return s; |
return s; |
91 |
} |
} |
92 |
|
|
93 |
public Collector get(byte[] key) { |
public Collector get(String key) { |
94 |
return new SimpleSetCollector(new HashSet(getSet(key))); |
return new SimpleSetCollector(new HashSet(getSet(key))); |
95 |
} |
} |
96 |
|
|