public String getOsisID() { // This range is exactly a whole book if (isWholeBook()) { // Just report the name of the book, we don't need to worry // about the base since we start at the start of a book, and // should have been recently normalized() return start.getBook().getOSIS(); } // If this range is exactly a whole chapter if (isWholeChapter()) { // Just report the name of the book and the chapter return start.getBook().getOSIS() + Verse.VERSE_OSIS_DELIM + start.getChapter(); } int startOrdinal = start.getOrdinal(); int endOrdinal = end.getOrdinal(); // to see if it is wholly contained in the range and output it if it is. // Estimate the size of the buffer: book.dd.dd (where book is 3-5, 3 typical) StringBuilder buf = new StringBuilder((endOrdinal - startOrdinal + 1) * 10); buf.append(start.getOsisID()); for (int i = startOrdinal + 1; i < endOrdinal; i++) { buf.append(AbstractPassage.REF_OSIS_DELIM); buf.append(v11n.decodeOrdinal(i).getOsisID()); } // It just might be a single verse range! if (startOrdinal != endOrdinal) { buf.append(AbstractPassage.REF_OSIS_DELIM); buf.append(end.getOsisID()); } return buf.toString(); }
if (isWholeBook()) {
if (isWholeBook()) {