class BibleBookList extends Object implements Iterable<BibleBook>, Serializable
The GNU Lesser General Public License for details.
Modifier and Type | Field and Description |
---|---|
private int[] |
bookMap
The bookMap maps from a BibleBook to the position that it has in
books . |
protected BibleBook[] |
books
The ordered books in this list
|
private static long |
serialVersionUID
Serialization ID
|
Constructor and Description |
---|
BibleBookList(BibleBook[] books)
Create an ordered BibleBookList from the input.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(BibleBook book)
Does this Versification contain the BibleBook.
|
BibleBook |
getBook(int ordinal)
Get the BibleBook by its position in this Versification.
|
int |
getBookCount()
Get the number of books in this Versification.
|
BibleBook |
getFirstBook()
Return the first book in the list.
|
BibleBook |
getLastBook()
Return the first book in the list.
|
BibleBook |
getNextBook(BibleBook book)
Given a BibleBook, get the next BibleBook in this Versification.
|
int |
getOrdinal(BibleBook book)
Where does the BibleBook come in the order of books of the Bible.
|
BibleBook |
getPreviousBook(BibleBook book)
Given a BibleBook, get the previous BibleBook in this Versification.
|
private void |
initialize()
The bookMap contains one slot for every BibleBook, indexed by it's ordinal value.
|
Iterator<BibleBook> |
iterator()
Get the BibleBooks in this Versification.
|
protected BibleBook[] books
private int[] bookMap
books
.private static final long serialVersionUID
BibleBookList(BibleBook[] books)
books
- public boolean contains(BibleBook book)
book
- public int getOrdinal(BibleBook book)
book
- public int getBookCount()
public BibleBook getBook(int ordinal)
ordinal
- public BibleBook getFirstBook()
public BibleBook getLastBook()
public BibleBook getPreviousBook(BibleBook book)
book
- A BibleBook in the Versificationpublic BibleBook getNextBook(BibleBook book)
book
- A BibleBook in the Versificationprivate void initialize()