/**
* Construct a {@link ImmutableStringStringMap}.
*/
public synchronized ImmutableStringStringMap build() throws DictionaryBuilderException
{
PerfectHashDictionary keyDict = new DictionaryBuilder().addAll(d_map.keySet()).buildPerfectHash(false);
PerfectHashDictionary valueDict = new DictionaryBuilder().addAll(new TreeSet<String>(d_map.values()))
.buildPerfectHash(false);
int links[] = new int[keyDict.size()];
for (Map.Entry<String, String> entry : d_map.entrySet())
{
int keyHashCode = keyDict.number(entry.getKey());
int valueHashCode = valueDict.number(entry.getValue());
links[keyHashCode - 1] = valueHashCode;
}
return new ImmutableStringStringMap(keyDict, valueDict, links);