/** * Increment/Decrement this verses in the rankings * * @param that * The verses to add/increment * @param tally * The amount to increment/decrement by */ private void alterVerseBase(Key that, int tally) { for (Key aKey : that) { Verse verse = (Verse) aKey; increment(verse.getOrdinal(), tally); } if (tally > 0) { incrementMax(tally); } }
@Override public void addAll(Key that) { optimizeWrites(); if (that instanceof PassageTally) { PassageTally tally = (PassageTally) that; int vib = getVersification().maximumOrdinal(); for (int i = 0; i <= vib; i++) { increment(i, tally.board[i]); } incrementMax(tally.max); } else { for (Key aKey : that) { Verse verse = (Verse) aKey; increment(verse.getOrdinal(), 1); } incrementMax(1); } fireIntervalAdded(this, null, null); }