Codota Logo
Versifications.getVersification
Code IndexAdd Codota to your IDE (free)

How to use
getVersification
method
in
org.crosswire.jsword.versification.system.Versifications

Best Java code snippets using org.crosswire.jsword.versification.system.Versifications.getVersification (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: crosswire/jsword

/**
 * Get the default Versification.
 *
 * @return the default Versification.
 * @deprecated Use {@link #getVersification(String)} instead.
 */
@Deprecated
public synchronized Versification getDefaultVersification() {
  return getVersification(DEFAULT_V11N);
}
origin: AndBible/and-bible

public Versification getDocumentVersification() {
  if (documentVersification!=null) {
    return documentVersification;
  } else {
    return Versifications.instance().getVersification(Versifications.DEFAULT_V11N);
  }
}
public void setDocumentVersification(Versification documentVersification) {
origin: AndBible/and-bible

public ConvertibleVerse(BibleBook book, int chapter, int verseNo) {
  this(Versifications.instance().getVersification(Versifications.DEFAULT_V11N), book, chapter, verseNo);
}
origin: AndBible/and-bible

  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);
      }
    }
  }
}
origin: AndBible/and-bible

/** 
 * 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;
}

origin: crosswire/jsword

/**
 * 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;
}
origin: crosswire/jsword

  /**
   * 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);
  }
}
origin: crosswire/jsword

public final Key createEmptyKeyList() {
  return keyf.createEmptyKeyList(Versifications.instance().getVersification(versification));
}
origin: AndBible/and-bible

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");
  }
}
origin: crosswire/jsword

/**
 * @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));
}
origin: crosswire/jsword

public Versification getVersification() {
  if (this.versificationSystem == null) {
    this.versificationSystem = Versifications.instance().getVersification(getBookMetaData().getProperty(BookMetaData.KEY_VERSIFICATION));
  }
  return versificationSystem;
}
origin: AndBible/and-bible

/**
 * @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);
  }
}

origin: crosswire/jsword

public final Key getKey(String text) throws NoSuchKeyException {
  return PassageKeyFactory.instance().getKey(Versifications.instance().getVersification(versification), text);
}
origin: crosswire/jsword

/**
 * 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;
}
origin: AndBible/and-bible

  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");
  }
}
origin: AndBible/and-bible

  private Verse getVerse(BibleBook book, int chapter, int verse) {
    Versification v11n = Versifications.instance().getVersification(SystemKJV.V11N_NAME);
    return new Verse(v11n, book, chapter, verse);
  }
}
origin: AndBible/and-bible

@Test
public void testGetVerseDescription() {
  Versification kjv = Versifications.instance().getVersification("KJV");
  Verse gen1_0 = new Verse(kjv, BibleBook.GEN, 1, 0);
  assertThat(CommonUtils.getKeyDescription(gen1_0), equalTo("Genesis 1"));
  Verse gen1_1 = new Verse(kjv, BibleBook.GEN, 1, 1);
  assertThat(CommonUtils.getKeyDescription(gen1_1), equalTo("Genesis 1:1"));
  Verse gen1_10 = new Verse(kjv, BibleBook.GEN, 1, 10);
  assertThat(CommonUtils.getKeyDescription(gen1_10), equalTo("Genesis 1:10"));
}
origin: AndBible/and-bible

public void testTrickyWebChapters() throws Exception {
  {
    OSISInputStream osisInputStream = new OSISInputStream(webBook, PassageKeyFactory.instance().getKey(Versifications.instance().getVersification("KJV"), "Ps 1"));
    String chapter = convertStreamToString(osisInputStream);
    int numOpeningLs = count(chapter, "<l>") + count(chapter, "<l ");
    int numClosingLs = count(chapter, "</l>");
    System.out.println(chapter);
    assertThat("wrong number of Ls", numOpeningLs, equalTo(numClosingLs));
  }
  {
    OSISInputStream osisInputStream = new OSISInputStream(webBook, PassageKeyFactory.instance().getKey(Versifications.instance().getVersification("KJV"), "Gen 49"));
    String chapter = convertStreamToString(osisInputStream);
    int numOpeningLs = count(chapter, "<l>") + count(chapter, "<l ");
    int numClosingLs = count(chapter, "</l>");
    System.out.println(chapter);
    assertThat("wrong number of Ls", numOpeningLs, equalTo(numClosingLs));
  }
}
origin: crosswire/jsword

public String readRawContent(RawBackendState state, Key key) throws IOException {
  String v11nName = getBookMetaData().getProperty(BookMetaData.KEY_VERSIFICATION);
  Versification v11n = Versifications.instance().getVersification(v11nName);
  Verse verse = KeyUtil.getVerse(key);
  int index = verse.getOrdinal();
  Testament testament = v11n.getTestament(index);
  index = v11n.getTestamentOrdinal(index);
  RawBackendState initState = null;
  try {
    initState = initState();
    return getEntry(state, verse.getName(), testament, index);
  } catch (BookException e) {
    return "";
  } finally {
    OpenFileStateManager.instance().release(initState);
  }
}
origin: crosswire/jsword

public void setAliasKey(RawFileBackendState state, Key alias, Key source) throws IOException {
  String v11nName = getBookMetaData().getProperty(BookMetaData.KEY_VERSIFICATION);
  Versification v11n = Versifications.instance().getVersification(v11nName);
  Verse aliasVerse = KeyUtil.getVerse(alias);
  Verse sourceVerse = KeyUtil.getVerse(source);
  int aliasIndex = aliasVerse.getOrdinal();
  Testament testament = v11n.getTestament(aliasIndex);
  aliasIndex = v11n.getTestamentOrdinal(aliasIndex);
  RandomAccessFile idxRaf = state.getIdxRaf(testament);
  int sourceOIndex = sourceVerse.getOrdinal();
  sourceOIndex = v11n.getTestamentOrdinal(sourceOIndex);
  DataIndex dataIndex = getIndex(idxRaf, sourceOIndex);
  // Only the index is updated to point to the same place as what is
  // linked.
  updateIndexFile(idxRaf, aliasIndex, dataIndex.getOffset());
}
org.crosswire.jsword.versification.systemVersificationsgetVersification

Javadoc

Get the Versification by its name. If name is null then return the default Versification.

Popular methods of Versifications

  • instance
    Get the singleton instance of Versifications.
  • fluff
  • isDefined
    Determine whether the named Versification is known.

Popular in Java

  • Creating JSON documents from java classes using gson
  • getResourceAsStream (ClassLoader)
  • onRequestPermissionsResult (Fragment)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • Menu (java.awt)
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JFileChooser (javax.swing)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now