public Passage trimRanges(int count, RestrictionType restrict) { optimizeWrites(); raiseNormalizeProtection(); int i = 0; boolean overflow = false; Passage remainder = this.clone(); Iterator<VerseRange> it = rangeIterator(restrict); while (it.hasNext()) { i++; Key range = it.next(); if (i > count) { remove(range); overflow = true; } else { remainder.remove(range); } } lowerNormalizeProtection(); // The event notification is done by the remove above if (overflow) { return remainder; } return null; }
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); } }
public Passage trimVerses(int count) { optimizeWrites(); raiseNormalizeProtection(); int i = 0; boolean overflow = false; Passage remainder = this.clone(); for (Key verse : this) { i++; if (i > count) { remove(verse); overflow = true; } else { remainder.remove(verse); } } lowerNormalizeProtection(); // The event notification is done by the remove above if (overflow) { return remainder; } return null; }
public void retainAll(Key key) { optimizeWrites(); raiseEventSuppresion(); raiseNormalizeProtection(); Passage temp = this.clone(); for (Key verse : temp) { if (!key.contains(verse)) { remove(verse); } } lowerNormalizeProtection(); if (lowerEventSuppressionAndTest()) { fireIntervalRemoved(this, null, null); } }
public void removeAll(Key key) { optimizeWrites(); raiseEventSuppresion(); raiseNormalizeProtection();
optimizeWrites(); raiseEventSuppresion(); raiseNormalizeProtection();