/** * Construct a VerseRange from a human readable string. For example * "Gen 1:1-3" in case the user does not want to have their typing 'fixed' * by a meddling patronizing computer. * * @param v11n * The versification for this VerseRange * @param orginal * The textual representation * @return the verse range for the string * @exception NoSuchVerseException * If the text can not be understood */ public static VerseRange fromString(Versification v11n, String orginal) throws NoSuchVerseException { return fromString(v11n, orginal, null); }
vrBasis = VerseRangeFactory.fromString(v11n, parts[0].trim()); VerseRange next = VerseRangeFactory.fromString(v11n, parts[i].trim(), vrBasis); add(next); vrBasis = next;
public VerseRange getIntentVerseRangeOrDefault(Intent intent) { //fetch verse from intent if set CurrentBiblePage currentDoc = BibleApplication.Companion.getApplication().getApplicationComponent().activeWindowPageManagerProvider().getActiveWindowPageManager().getCurrentBible(); Versification currentV11n = currentDoc.getCurrentPassageBook().getVersification(); try { Bundle extras = intent.getExtras(); if (extras != null && extras.containsKey(VERSE_RANGE)) { return VerseRangeFactory.fromString(currentV11n, extras.getString(VERSE_RANGE)); } } catch (Exception e) { Log.e(TAG, "Error getting Verse Range from intent, using default"); } // if we got this far there was no verse in the intent final Verse defaultVerse = currentDoc.getSingleKey(); return new VerseRange(currentV11n, defaultVerse); }
dto.setVerseRange(VerseRangeFactory.fromString(v11n, key)); } catch (Exception e) { Log.e(TAG, "Note saved with incorrect versification", e); dto.setVerseRange(VerseRangeFactory.fromString(v11nWithDC, key));
dto.setVerseRange(VerseRangeFactory.fromString(v11n, key));
private BookmarkDto addBookmark(String verse) throws NoSuchVerseException { BookmarkDto bookmark = new BookmarkDto(); bookmark.setVerseRange(VerseRangeFactory.fromString(KJV_VERSIFICATION, verse)); return bookmarkControl.addOrUpdateBookmark(bookmark); }