/** * If leftKey is non-null (i.e. not attached to a simple specifier, then adds to the kjvTo mappings * * @param kjvVerses the kjv verses * @param leftKey the left-hand key, possibly null. */ private void addKJVToMapping(final QualifiedKey kjvVerses, final Verse leftKey) { // NOTE(DMS): Both kjvVerses and left key are each a single verse if (leftKey != null) { getNonEmptyKey(this.fromKJVMappings, kjvVerses).addAll(leftKey); // If we have a part, then we need to add the whole verse as well... if (!kjvVerses.isWhole()) { getNonEmptyKey(this.fromKJVMappings, QualifiedKey.create(kjvVerses.getKey().getWhole())).addAll(leftKey); } } }
/** * @param kjvVerses the list of keys * @return the aggregate key */ private VerseKey getKeyFromQualifiedKeys(Versification versification, final List<QualifiedKey> kjvVerses) { final VerseKey finalKey = new RangedPassage(versification); for (QualifiedKey k : kjvVerses) { // we simply ignore everything else at this stage. The other bits // and pieces are used while we're converting // from one to the other. if (k.getKey() != null) { finalKey.addAll(k.getKey()); } } return finalKey; }
/** * This is a last attempt at trying to get something, on the basis that * something is better than nothing. * * @param targetVersification the target versification * @param kjvVerses the verses in the KJV versification. * @return the possible verses in the target versification, no guarantees * made */ private VerseKey guessKeyFromKjvVerses(final Versification targetVersification, final List<QualifiedKey> kjvVerses) { final VerseKey finalKeys = new RangedPassage(targetVersification); for (QualifiedKey qualifiedKey : kjvVerses) { if (qualifiedKey.getKey() != null) { final VerseKey key = qualifiedKey.reversify(targetVersification).getKey(); if (key != null) { //verse key exists in target versification finalKeys.addAll(key); } } } return finalKeys; }
if (verseKey != null) { finalKeys.addAll(verseKey);