コード例 #1
0
  /** Get books in current Document - either all Scripture books or all non-Scripture books */
  public List<BibleBook> getBibleBooks(boolean isScriptureRequired) {
    List<BibleBook> books = new ArrayList<BibleBook>();

    AbstractPassageBook currentPassageDocument = getCurrentPassageDocument();
    List<BibleBook> documentBookList =
        documentBibleBooksFactory.getBooksFor(currentPassageDocument);

    for (BibleBook bibleBook : documentBookList) {
      if (isScriptureRequired == Scripture.isScripture(bibleBook)) {
        books.add(bibleBook);
      }
    }

    books = getSortedBibleBooks(books, currentPassageDocument.getVersification());

    return books;
  }
コード例 #2
0
ファイル: BooksTest.java プロジェクト: crosswire/jsword
 /**
  * Bibles like TurNTB contain merged (linked) verses which are duplicated when chapters are
  * displayed- see JS-224. This tests the deduplication code in AbstractPassageBook.
  *
  * @throws Exception
  */
 @Test
 public void testBookList() throws Exception {
   // part of the pre-requisites
   AbstractPassageBook esv = (AbstractPassageBook) Books.installed().getBook("ESV");
   Assert.assertTrue(esv.getBibleBooks().contains(BibleBook.ACTS));
 }