/** * Allow override of the key, particular useful if we're constructing in 2 stages like the offset mechanism * * @param key the new key */ private void setKey(final Verse key) { this.qualifiedKey = key; this.wholeKey = key.getWhole(); }
/** * Converts a KJV verse to the target versification, from a qualified key, rather than a real key * * @param kjvVerse the verse from the KJV * @return the key in the left-hand versification */ public VerseKey unmap(final QualifiedKey kjvVerse) { // TODO(CJB): cope for parts? Passage left = this.fromKJVMappings.get(kjvVerse); if (left == null && !kjvVerse.isWhole()) { // Try again, but without the part this time left = this.fromKJVMappings.get(new QualifiedKey(kjvVerse.getVerse().getWhole())); } //if we have no mapping, then we are in 1 of two scenarios //the verse is either totally absent, or the verse is not part of the mappings, meaning it is a straight map if (left == null) { VerseKey vk = kjvVerse.getKey(); if (vk != null && this.absentVerses.contains(vk)) { return createEmptyPassage(KJV); } return kjvVerse.reversify(this.nonKjv).getKey(); } return left; }