public synchronized void addAll(Key key) { ref.addAll(key); }
/** * Maps a whole passage, and does so verse by verse. We can't do any better, since, we may for * example have: * Ps.1.1-Ps.1.10 => Ps.1.2-Ps.1.11 so one would think we can simply map each of the start and end verses. * However, this would be inaccurate since verse 9 might map to verse 12, 13, etc. * * @param key the key if the source versification * @param target the target versification * @return the new key in the new versification */ public Passage map(final Passage key, final Versification target) { if (key.getVersification().equals(target)) { return key; } Passage newPassage = new RangedPassage(target); Iterator<Key> verses = key.iterator(); while (verses.hasNext()) { Verse verse = (Verse) verses.next(); newPassage.addAll(this.mapVerse(verse, target)); } return newPassage; }
/** * Adds a 1-Many mapping, by simply listing out all the properties. There is probably * a better way for storing this, perhaps in a tree - but for simplicity, we're going to list them out. * * @param leftHand the left hand side operand * @param kjvVerses the verses that are mapped by the left hand side */ private void addMappings(final QualifiedKey leftHand, final QualifiedKey kjvVerses) throws NoSuchVerseException { if (leftHand.getAbsentType() == QualifiedKey.Qualifier.ABSENT_IN_LEFT) { this.absentVerses.addAll(kjvVerses.getKey()); } else if (leftHand.getKey().getCardinality() == 1) { add1ToManyMappings(leftHand.getVerse(), kjvVerses); } else { addManyToMany(leftHand, kjvVerses); } }