public Iterator<VerseRange> rangeIterator(RestrictionType restrict) { return new VerseRangeIterator(getVersification(), iterator(), restrict); }
public void clear() { optimizeWrites(); raiseNormalizeProtection(); remove(getVersification().getAllVerses()); if (lowerEventSuppressionAndTest()) { fireIntervalRemoved(this, null, null); } }
public void blur(int verses, RestrictionType restrict) { optimizeWrites(); raiseEventSuppresion(); raiseNormalizeProtection(); Passage temp = this.clone(); Iterator<VerseRange> it = temp.rangeIterator(RestrictionType.NONE); while (it.hasNext()) { VerseRange range = restrict.blur(getVersification(), it.next(), verses, verses); add(range); } lowerNormalizeProtection(); if (lowerEventSuppressionAndTest()) { fireIntervalAdded(this, null, null); } }
int ord = is.readInt(); int count = is.readInt(); add(RestrictionType.NONE.toRange(getVersification(), v11n.decodeOrdinal(ord), count));
public int compareTo(Key obj) { Passage thatref = (Passage) obj; if (thatref.countVerses() == 0) { if (countVerses() == 0) { return 0; } // that is empty so he should come before me return -1; } if (countVerses() == 0) { // we are empty be he isn't so we are first return 1; } Verse thatfirst = thatref.getVerseAt(0); Verse thisfirst = getVerseAt(0); return getVersification().distance(thatfirst, thisfirst); }