public Versification getDocumentVersification() { if (documentVersification!=null) { return documentVersification; } else { return Versifications.instance().getVersification(Versifications.DEFAULT_V11N); } } public void setDocumentVersification(Versification documentVersification) {
/** * Get the Versification by its name. If name is null then return the default Versification. * * @param name the name of the Versification * @return the Versification or null if it is not known. */ public synchronized Versification getVersification(String name) { String actual = name; if (actual == null) { actual = DEFAULT_V11N; } // This class delays the building of a Versification to when it is // actually needed. Versification rs = fluffed.get(actual); if (rs == null) { rs = fluff(actual); if (rs != null) { fluffed.put(actual, rs); } } return rs; }
private void adjustBookType() { // The book type represents the underlying category of book. // Fine tune it here. BookCategory focusedCategory = (BookCategory) getValue(KEY_CATEGORY); questionable = focusedCategory == BookCategory.QUESTIONABLE; String modTypeName = getProperty(KEY_MOD_DRV); if (modTypeName == null) { LOGGER.error("Book not supported: malformed conf file for [{}] no {} found.", configAll.getName(), KEY_MOD_DRV); supported = false; return; } String v11n = getProperty(KEY_VERSIFICATION); if (!Versifications.instance().isDefined(v11n)) { LOGGER.error("Book not supported: Unknown versification for [{}]{}={}.", configAll.getName(), KEY_VERSIFICATION, v11n); supported = false; return; } bookType = BookType.fromString(modTypeName); if (bookType == null) { LOGGER.error("Book not supported: malformed conf file for [{}] no book type found", configAll.getName()); supported = false; return; } // The book type represents the underlying category of book. // Fine tune it here. if (focusedCategory == BookCategory.OTHER) { focusedCategory = bookType.getBookCategory(); } setProperty(KEY_CATEGORY, focusedCategory.getName()); }
/** * Get the default Versification. * * @return the default Versification. * @deprecated Use {@link #getVersification(String)} instead. */ @Deprecated public synchronized Versification getDefaultVersification() { return getVersification(DEFAULT_V11N); }
public ConvertibleVerse(BibleBook book, int chapter, int verseNo) { this(Versifications.instance().getVersification(Versifications.DEFAULT_V11N), book, chapter, verseNo); }
/** * Get the versification for the key or the default versification. * * @param key the key that should provide for the Versification * @return the versification for the key */ public static Versification getVersification(Key key) { if (key instanceof VerseKey) { return ((VerseKey) key).getVersification(); } return Versifications.instance().getVersification(Versifications.DEFAULT_V11N); } }
/** * Get versification specified in properties file e.g. 'Versification=Vulg' * Default to KJV. * If specified Versification is not found then use NRSVA because it includes most books possible */ private Versification getReadingPlanVersification(String planCode) { Versification versification; try { String versificationName = getPlanProperties(planCode).getProperty(VERSIFICATION, DEFAULT_VERSIFICATION); versification = Versifications.instance().getVersification(versificationName); } catch (Exception e) { Log.e(TAG, "Error loading versification from Reading plan:"+planCode); versification = Versifications.instance().getVersification(INCLUSIVE_VERSIFICATION); } return versification; }
public final Key createEmptyKeyList() { return keyf.createEmptyKeyList(Versifications.instance().getVersification(versification)); }
public void restoreState(JSONObject jsonObject) throws JSONException { if (jsonObject!=null) { if (jsonObject.has("versification") && jsonObject.has("bibleBook")) { Versification v11n = Versifications.instance().getVersification(jsonObject.getString("versification")); int bibleBookNo = jsonObject.getInt("bibleBook"); int chapterNo = jsonObject.getInt("chapter"); int verseNo = jsonObject.getInt("verseNo"); mainVerse = new Verse(v11n, BibleBook.values()[bibleBookNo], chapterNo, verseNo, true); } } } }
public Versification getVersification() { try { // Bibles must be a PassageBook return ((AbstractPassageBook)getCurrentDocument()).getVersification(); } catch (Exception e) { Log.e(TAG, "Error getting versification for Book", e); return Versifications.instance().getVersification("KJV"); } }
/** * @param i the current position in the array of books * @return the versification of the book. */ private Versification getVersification(final int i) { return Versifications.instance().getVersification( books[i].getBookMetaData().getProperty(BookMetaData.KEY_VERSIFICATION)); }
public Versification getVersification() { if (this.versificationSystem == null) { this.versificationSystem = Versifications.instance().getVersification(getBookMetaData().getProperty(BookMetaData.KEY_VERSIFICATION)); } return versificationSystem; }
/** * @return v11n of current document */ public Versification getVersification() { AbstractPassageBook doc = getCurrentPassageDocument(); // this should always be true if (doc!=null) { return doc.getVersification(); } else { // but safety first return Versifications.instance().getVersification(SystemKJV.V11N_NAME); } }
/** * Write out the object to the given ObjectOutputStream * * @param in * The stream to read our state from * @throws IOException * if the read fails * @throws ClassNotFoundException * If the read data is incorrect * @serialData Write the ordinal number of this verse */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); String v11nName = in.readUTF(); v11n = Versifications.instance().getVersification(v11nName); Verse decoded = v11n.decodeOrdinal(ordinal); this.book = decoded.book; this.chapter = decoded.chapter; this.verse = decoded.verse; }
public final Key getKey(String text) throws NoSuchKeyException { return PassageKeyFactory.instance().getKey(Versifications.instance().getVersification(versification), text); }
/** * Read a passage from a given stream * * @param in * The stream to read from * @return a newly built Passage * @throws IOException * If there was trouble reading the stream * @throws NoSuchKeyException * if the data was not a valid passage */ public static Passage readPassage(Reader in) throws IOException, NoSuchKeyException { // Get any versification. It does not matter. readDescripton will overwrite it. Versification rs = Versifications.instance().getVersification("KJV"); Passage ref = (Passage) keyf.createEmptyKeyList(rs); ref.readDescription(in); return ref; }
Versification findPreferredCompatibleVersification(ConvertibleVerseRange convertibleVerseRange1, ConvertibleVerseRange convertibleVerseRange2) { for (Versification v11n : versificationsInOrderOfPreference) { if (convertibleVerseRange1.isConvertibleTo(v11n) && convertibleVerseRange2.isConvertibleTo(v11n)) { return v11n; } } log.error("Cannot find compatible versification for "+convertibleVerseRange1+" and "+convertibleVerseRange2+". Returning KJVA."); return Versifications.instance().getVersification("KJVA"); } }
/** * Call the support mechanism in AbstractPassage * * @param in * The stream to read our state from * @throws IOException * if the read fails * @throws ClassNotFoundException * If the read data is incorrect * @serialData Write the ordinal number of this verse * @see AbstractPassage#readObjectSupport(ObjectInputStream) */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { optimizeWrites(); in.defaultReadObject(); // Read the versification by name String v11nName = in.readUTF(); Versification v11n = Versifications.instance().getVersification(v11nName); store = new BitSet(v11n.maximumOrdinal() + 1); readObjectSupport(in); }
private Verse getVerse(BibleBook book, int chapter, int verse) { Versification v11n = Versifications.instance().getVersification(SystemKJV.V11N_NAME); return new Verse(v11n, book, chapter, verse); } }
String v11nString = c.getString(BookmarkQuery.VERSIFICATION); if (!StringUtils.isEmpty(v11nString)) { v11n = Versifications.instance().getVersification(v11nString); v11n = Versifications.instance().getVersification(Versifications.DEFAULT_V11N);