if (key instanceof Passage) { Passage that = (Passage) key; fireIntervalAdded(this, that.getVerseAt(0), that.getVerseAt(that.countVerses() - 1)); } else if (key instanceof VerseRange) { VerseRange that = (VerseRange) key; fireIntervalAdded(this, that.getStart(), that.getEnd()); } else if (key instanceof Verse) { Verse that = (Verse) key; fireIntervalAdded(this, that, that);
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 void readDescription(Reader in) throws IOException, NoSuchVerseException { raiseEventSuppresion(); raiseNormalizeProtection(); int count = 0; // number of lines read // Quiet Android from complaining about using the default BufferReader buffer size. // The actual buffer size is undocumented. So this is a good idea any way. BufferedReader bin = new BufferedReader(in, 8192); String v11nName = bin.readLine(); v11n = Versifications.instance().getVersification(v11nName); while (true) { String line = bin.readLine(); if (line == null) { break; } count++; addVerses(line, null); } // If the file was empty then there is nothing to do if (count == 0) { return; } lowerNormalizeProtection(); if (lowerEventSuppressionAndTest()) { fireIntervalAdded(this, getVerseAt(0), getVerseAt(countVerses() - 1)); } }