@Override public int count(Passage ref, RestrictionType restrict) { if (ref == null) { return 0; } return ref.countVerses(); } },
public synchronized int countVerses() { return ref.countVerses(); }
public int countVerses() { return ref.countVerses(); }
} else { Passage ref = (Passage) PassageKeyFactory.instance().getKey(parameters.getDocumentVersification(), reference); boolean isSingleVerse = ref.countVerses()==1; boolean hasContent = content.length()>0; boolean hasSeparateRefs = reference.contains(" ");
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); }
if (key instanceof Passage) { Passage that = (Passage) key; fireIntervalRemoved(this, that.getVerseAt(0), that.getVerseAt(that.countVerses() - 1)); } else if (key instanceof VerseRange) { VerseRange that = (VerseRange) key;
@Override public void addAll(Key key) { //check for key empty. This avoids the AIOBounds with that.getVerseAt, during event firing if (key.isEmpty()) { //nothing to add return; } optimizeWrites(); if (key instanceof BitwisePassage) { BitwisePassage thatRef = (BitwisePassage) key; store.or(thatRef.store); } else { super.addAll(key); } // we do an extra check here because the cost of calculating the // params is non-zero and may be wasted if (suppressEvents == 0 && !key.isEmpty()) { 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); } } }
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;
@Override public void removeAll(Key key) { optimizeWrites(); if (key instanceof BitwisePassage) { BitwisePassage thatRef = (BitwisePassage) key; store.andNot(thatRef.store); } else { super.removeAll(key); } // we do an extra check here because the cost of calculating the // params is non-zero and may be wasted if (suppressEvents == 0 && !key.isEmpty()) { if (key instanceof Passage) { Passage that = (Passage) key; fireIntervalRemoved(this, that.getVerseAt(0), that.getVerseAt(that.countVerses() - 1)); } else if (key instanceof VerseRange) { VerseRange that = (VerseRange) key; fireIntervalRemoved(this, that.getStart(), that.getEnd()); } else if (key instanceof Verse) { Verse that = (Verse) key; fireIntervalRemoved(this, that, that); } } }
int maxOrdinal = v11n.maximumOrdinal(); int verses = ref.countVerses(); int ranges = ref.countRanges(RestrictionType.NONE);