@Override public boolean contains(Key obj) { // Even for the contains(VerseRange) case, the simple // 'return store.contains(that);' will not work because // VerseRanges can contain others but not be equal to them. VerseRange thatRange = toVerseRange(getVersification(), obj); Iterator<VerseRange> it = rangeIterator(RestrictionType.NONE); while (it.hasNext()) { VerseRange thisRange = it.next(); if (thisRange.contains(thatRange)) { return true; } } // If it is not a Verse or a VerseRange then it's not here, // this also copes with the searches failing. return false; }
if (((VerseRange)passage).contains(verseRange.getStart())) { versesInPassage.add(verseRange.getStart());