Codota Logo
BibleBook
Code IndexAdd Codota to your IDE (free)

How to use
BibleBook
in
org.crosswire.jsword.versification

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: crosswire/jsword

/**
 * Does this Versification contain the BibleBook.
 *
 * @param book
 * @return true if it is present.
 */
public boolean contains(BibleBook book) {
  return book != null && bookMap[book.ordinal()] != -1;
}
origin: crosswire/jsword

/**
 * The bookMap contains one slot for every BibleBook, indexed by it's ordinal value.
 * The value of that entry is the position of the book in the BookList.
 * If the BibleBook is not present in books, it's value is -1.
 */
private void initialize() {
  bookMap = new int[BibleBook.values().length + 1];
  // Initialize all slots to -1
  for (BibleBook b : BibleBook.values()) {
    bookMap[b.ordinal()] = -1;
  }
  // Fill in the position of the books into that list
  for (int i = 0; i < books.length; i++) {
    bookMap[books[i].ordinal()] = i;
  }
}
origin: crosswire/jsword

@Override
public int hashCode() {
  return book.hashCode();
}
origin: crosswire/jsword

/**
 * Gets the common name of the verse, excluding any !abc sub-identifier
 * @return the verse OSIS-ID, excluding the sub-identifier
 */
private StringBuilder getVerseIdentifier() {
  StringBuilder buf = new StringBuilder();
  buf.append(book.getOSIS());
  buf.append(Verse.VERSE_OSIS_DELIM);
  buf.append(chapter);
  buf.append(Verse.VERSE_OSIS_DELIM);
  buf.append(verse);
  return buf;
}
origin: crosswire/jsword

private void store(ResourceBundle resources, BibleBook book, Map fullMap, Map shortMap, Map altMap) {
  String osisName = book.getOSIS();
  String fullBook = getString(resources, osisName + FULL_KEY);
  String shortBook = getString(resources, osisName + SHORT_KEY);
  if (shortBook.length() == 0) {
    shortBook = fullBook;
  }
  String altBook = getString(resources, osisName + ALT_KEY);
  BookName bookName = new BookName(locale, BibleBook.fromOSIS(osisName), fullBook, shortBook, altBook);
  books.put(book, bookName);
  fullMap.put(bookName.getNormalizedLongName(), bookName);
  shortMap.put(bookName.getNormalizedShortName(), bookName);
  String[] alternates = StringUtil.split(BookName.normalize(altBook, locale), ',');
  for (int j = 0; j < alternates.length; j++) {
    altMap.put(alternates[j], bookName);
  }
}
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: crosswire/jsword

StringBuilder buf = new StringBuilder();
if (book.isShortBook()) {
  if (verseBase == null || verseBase.book != book) {
    buf.append(BibleNames.instance().getPreferredName(book));
origin: crosswire/jsword

private Set<BibleBook> fromString(String list) {
  Set<BibleBook> books = new LinkedHashSet<BibleBook>(list.length() / 2);
  final String[] bookOsis = StringUtil.split(list, ' ');
  for (String s : bookOsis) {
    books.add(BibleBook.fromExactOSIS(s));
  }
  return books;
}
origin: crosswire/jsword

/**
 * Get a book from its name.
 *
 * @param find
 *            The string to identify
 * @return The BibleBook, On error null
 */
public BibleBook getBook(String find) {
  BibleBook book = null;
  if (containsLetter(find)) {
    book = BibleBook.fromOSIS(find);
    if (book == null) {
      book = getLocalizedBibleNames().getBook(find, false);
    }
    if (book == null) {
      book = englishBibleNames.getBook(find, false);
    }
    if (book == null) {
      book = getLocalizedBibleNames().getBook(find, true);
    }
    if (book == null) {
      book = englishBibleNames.getBook(find, true);
    }
  }
  return book;
}
origin: crosswire/jsword

private String toString(Set<BibleBook> books) {
  StringBuilder sb = new StringBuilder(books.size() * 8);
  for (Iterator<BibleBook> iterator = books.iterator(); iterator.hasNext(); ) {
    BibleBook b = iterator.next();
    sb.append(b.getOSIS());
    if (iterator.hasNext()) {
      sb.append(' ');
    }
  }
  return sb.toString();
}
origin: AndBible/and-bible

/** default book for use when jumping into the middle of passage selection
 */
public int getDefaultBibleBookNo() {
  return Arrays.binarySearch(BibleBook.values(), pageControl.getCurrentBibleVerse().getBook());
}
origin: AndBible/and-bible

/**
 * Some IBT books mistakenly had dummy empty verses which returned the following for verse 1,2,... lastVerse-1  
 * <chapter eID="gen7" osisID="1Esd.1"/>
 * <chapter eID="gen1010" osisID="Mal.3"/>
 */
private boolean isProbablyEmptyVerseInDocument(Book document, Verse verse) {
  int rawTextLength = ((AbstractBook)document).getBackend().getRawTextLength(verse);
  
  if (verse.getBook().isShortBook()) {
    return isProbablyShortBookEmptyVerseStub(rawTextLength);
  } else {
    return isProbablyEmptyVerseStub(rawTextLength);
  }
}

origin: crosswire/jsword

private Verse parseOsisID(final Versification v11n, final List<String> osisIDParts) {
  final BibleBook b = BibleBook.fromExactOSIS(osisIDParts.get(0));
  if (b == null) {
    return null;
  }
  // Allow a Verse to have a sub identifier on the last part.
  // We should use it, but throwing it away for now.
  String[] endParts = StringUtil.splitAll(osisIDParts.get(2), Verse.VERSE_OSIS_SUB_PREFIX);
  String subIdentifier = null;
  if (endParts.length == 2 && endParts[1].length() > 0) {
    subIdentifier = endParts[1];
  }
  return new Verse(v11n, b, Integer.parseInt(osisIDParts.get(1)), Integer.parseInt(endParts[0]), subIdentifier);
}
origin: crosswire/jsword

@Override
public boolean contains(BibleBook book) {
  int bookNum = book.ordinal();
  return bookNum >= BibleBook.JOSH.ordinal() && bookNum <= BibleBook.ESTH.ordinal();
}
origin: crosswire/jsword

int otCount = 0;
int ncCount = 0;
BibleBook[] bibleBooks = BibleBook.values();
for (BibleBook book : bibleBooks) {
  int ordinal = book.ordinal();
  if (ordinal > BibleBook.INTRO_OT.ordinal() && ordinal < BibleBook.INTRO_NT.ordinal()) {
    ++ntCount;
  } else if (ordinal > BibleBook.INTRO_NT.ordinal() && ordinal <= BibleBook.REV.ordinal()) {
    ++otCount;
  } else {
shortNT = new HashMap<String, BookName>(ntCount);
altNT = new HashMap<String, BookName>(ntCount);
for (int i = BibleBook.MATT.ordinal(); i <= BibleBook.REV.ordinal(); ++i) {
  BibleBook book = bibleBooks[i];
  store(resources, book, fullNT, shortNT, altNT);
shortOT = new HashMap<String, BookName>(otCount);
altOT = new HashMap<String, BookName>(otCount);
for (int i = BibleBook.GEN.ordinal(); i <= BibleBook.MAL.ordinal(); ++i) {
  BibleBook book = bibleBooks[i];
  store(resources, book, fullOT, shortOT, altOT);
store(resources, BibleBook.INTRO_OT, fullNC, shortNC, altNC);
store(resources, BibleBook.INTRO_NT, fullNC, shortNC, altNC);
for (int i = BibleBook.REV.ordinal() + 1; i < bibleBooks.length; ++i) {
  BibleBook book = bibleBooks[i];
  store(resources, book, fullNC, shortNC, altNC);
origin: AndBible/and-bible

public List<BookmarkDto> getBookmarksInBook(BibleBook book) {
  Log.d(TAG, "about to getBookmarksInPassage:"+book.getOSIS());
  List<BookmarkDto> bookmarkList = new ArrayList<>();
  Cursor c = db.query(BookmarkQuery.TABLE, BookmarkQuery.COLUMNS, BookmarkColumn.KEY+" LIKE ?", new String []{String.valueOf(book.getOSIS()+".%")}, null, null, null);
  try {
    if (c.moveToFirst()) {
      while (!c.isAfterLast()) {
        BookmarkDto bookmark = getBookmarkDto(c);
        bookmarkList.add(bookmark);
          c.moveToNext();
      }
    }
  } finally {
    c.close();
  }
  
  Log.d(TAG, "bookmarksInPassage set to " + bookmarkList.size() + " item long list");
  return bookmarkList;
}
origin: crosswire/jsword

final BibleBook book = BibleBook.fromExactOSIS(bookName);
origin: crosswire/jsword

@Override
public boolean contains(BibleBook book) {
  int bookNum = book.ordinal();
  return bookNum >= BibleBook.ROM.ordinal() && bookNum <= BibleBook.JUDE.ordinal();
}
origin: AndBible/and-bible

public List<MyNoteDto> getMyNotesInBook(BibleBook book) {
  Log.d(TAG, "about to getMyNotesInPassage:"+book.getOSIS());
  List<MyNoteDto> notesList = new ArrayList<MyNoteDto>();
  Cursor c = db.query(MyNoteQuery.TABLE, MyNoteQuery.COLUMNS, MyNoteColumn.KEY+" LIKE ?", new String []{String.valueOf(book.getOSIS()+".%")}, null, null, null);
  try {
    if (c.moveToFirst()) {
      while (!c.isAfterLast()) {
        MyNoteDto mynote = getMyNoteDto(c);
        notesList.add(mynote);
          c.moveToNext();
      }
    }
  } finally {
    c.close();
  }
  
  Log.d(TAG, "myNotesInPassage set to " + notesList.size() + " item long list");
  return notesList;
}
origin: crosswire/jsword

@Override
public boolean contains(BibleBook book) {
  int bookNum = book.ordinal();
  return bookNum >= BibleBook.GEN.ordinal() && bookNum <= BibleBook.REV.ordinal();
}
org.crosswire.jsword.versificationBibleBook

Javadoc

A BibleBook is a book of the Bible. It may or may not be canonical. Note that the ordering of these books varies from one Versification to another.

Most used methods

  • ordinal
  • getOSIS
    Get the OSIS representation of this BibleBook.
  • isShortBook
  • values
  • fromExactOSIS
  • fromOSIS
    Case insensitive search for BibleBook for an OSIS name.
  • hashCode

Popular in Java

  • Reading from database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • notifyDataSetChanged (ArrayAdapter)
  • requestLocationUpdates (LocationManager)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Socket (java.net)
    Provides a client-side TCP socket.
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
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