TIntObjectHashMap<TLongDoubleHashMap> lev1 = this.map.get(len1);
if (lev1 == null) {
lev1 = new TIntObjectHashMap<TLongDoubleHashMap>();
map.put(len1, lev1);
}
TLongDoubleHashMap lev2 = lev1.get(len2);
if (lev2 == null) {
lev2 = new TLongDoubleHashMap();
lev1.put(len2, lev2);
}
final long key = hash(str1, str2);
if (!lev2.contains(key)) {
aligner.setSequences(str1, str2);
aligner.buildMatrix();
ans = aligner.getAlignmentScore();
lev2.put(key, ans);
// if the same length hash them both
if (str1.length() == str2.length()) {
lev2.put(hash(str2, str1), ans);
}
usedCache = false;
} else {
ans = lev2.get(key);
usedCache = true;
}
}
}