org.crosswire.jsword.versification
Class BibleInfo

java.lang.Object
  extended by org.crosswire.jsword.versification.BibleInfo

Deprecated. Use Versifications.instance().getDefaultVersification() instead.

@Deprecated
public final class BibleInfo
extends Object

BibleInfo is a static class that deals with Bible book names, and conversion to and from ordinal number and Verse.

This class is likely to be reworked in it's entirety. It is really only true of the KJV Bible. It is not true of other versifications such as Luther's.

Author:
Joe Walker [joe at eireneh dot com], DM Smith
See Also:
for license details.
The copyright to this program is held by it's authors.

Field Summary
static int TESTAMENT_NEW
          Deprecated. use Testament.NEW instead.
static int TESTAMENT_OLD
          Deprecated. use Testament.OLD instead.
private static Versification v11n
          Deprecated.  
 
Constructor Summary
private BibleInfo()
          Deprecated. Ensure that we can not be instantiated
 
Method Summary
static int booksInBible()
          Deprecated. use Versification.getBookCount() instead
static int chaptersInBible()
          Deprecated. do not use
static int chaptersInBook(BibleBook book)
          Deprecated. use Versification.getLastChapter(BibleBook) instead
static Verse decodeOrdinal(int ordinal)
          Deprecated. use Versification.decodeOrdinal(int) instead
static BibleBook getBook(String find)
          Deprecated. use Versification.getBook(String)
static BookName getBookName(BibleBook book)
          Deprecated. Use Versification#getBookName() instead.
static BibleBook[] getBooks()
          Deprecated. No replacement
static int getCase()
          Deprecated. use BookName.getCase()
static int getCount(Testament testament)
          Deprecated. use Versification.getCount(Testament) instead
static CaseType getDefaultCase()
          Deprecated. use BookName.getDefaultCase()
static String getLongBookName(BibleBook book)
          Deprecated. Use Versification.getLongName(BibleBook) instead.
static BibleBook getNextBook(BibleBook book)
          Deprecated. Use Versification.getNextBook(BibleBook) instead
static int getOrdinal(Verse verse)
          Deprecated. use Verse.getOrdinal() instead
static String getOSISName(BibleBook book)
          Deprecated. Use BibleBook.getOSIS() instead.
static String getPreferredBookName(BibleBook book)
          Deprecated. Use Versification.getPreferredName(BibleBook) instead.
static BibleBook getPreviousBook(BibleBook book)
          Deprecated. Use Versification.getPreviousBook(BibleBook) instead.
static String getShortBookName(BibleBook book)
          Deprecated. Use Versification.getShortName(BibleBook) instead.
static Testament getTestament(int ordinal)
          Deprecated. use Versification.getTestament(int) instead
static int getTestamentOrdinal(int ordinal)
          Deprecated. use Versification.getTestamentOrdinal(int) instead
static boolean isBookName(String find)
          Deprecated. use Versification.isBook(String)
static boolean isFullBookName()
          Deprecated. use BookName.isFullBookName()
static int maximumOrdinal()
          Deprecated. use Versification.maximumOrdinal() instead
static Verse patch(BibleBook book, int chapter, int verse)
          Deprecated. use Versification.patch(BibleBook, int, int) instead
static void setCase(CaseType newBookCase)
          Deprecated. use BookName.setCase(CaseType)
static void setCase(int bookCase)
          Deprecated. use BookName.setCase(int)
static void setFullBookName(boolean fullName)
          Deprecated. use BookName.setFullBookName(boolean)
static void validate(BibleBook book, int chapter, int verse)
          Deprecated. use Versification.validate(BibleBook, int, int) instead
static int verseCount(Verse verse1, Verse verse2)
          Deprecated. Use + 1 instead.
static int versesInBible()
          Deprecated. use maximumOrdinal()
static int versesInChapter(BibleBook book, int chapter)
          Deprecated. use Versification.getLastVerse(BibleBook, int) instead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TESTAMENT_OLD

@Deprecated
public static final int TESTAMENT_OLD
Deprecated. use Testament.OLD instead.
constant for the old testament

See Also:
Constant Field Values

TESTAMENT_NEW

@Deprecated
public static final int TESTAMENT_NEW
Deprecated. use Testament.NEW instead.
constant for the new testament

See Also:
Constant Field Values

v11n

private static Versification v11n
Deprecated. 
Constructor Detail

BibleInfo

private BibleInfo()
Deprecated. 
Ensure that we can not be instantiated

Method Detail

getNextBook

@Deprecated
public static BibleBook getNextBook(BibleBook book)
Deprecated. Use Versification.getNextBook(BibleBook) instead

Get the immediately following book in the current versification.

Parameters:
book -
Returns:
the next book or null if no following book

getPreviousBook

@Deprecated
public static BibleBook getPreviousBook(BibleBook book)
Deprecated. Use Versification.getPreviousBook(BibleBook) instead.

Get the immediately prior book in the current versification.

Parameters:
book -
Returns:
the previous book or null if no previous book

getBooks

@Deprecated
public static BibleBook[] getBooks()
Deprecated. No replacement

Get the ordered array of books belonging to this versification. This includes the 3 introductions.

Returns:
the array of books

chaptersInBook

@Deprecated
public static int chaptersInBook(BibleBook book)
Deprecated. use Versification.getLastChapter(BibleBook) instead

Get the last valid chapter number for a book.

Parameters:
book - The book part of the reference.
Returns:
The last valid chapter number for a book.

versesInChapter

@Deprecated
public static int versesInChapter(BibleBook book,
                                             int chapter)
Deprecated. use Versification.getLastVerse(BibleBook, int) instead

Get the last valid verse number for a chapter.

Parameters:
book - The book part of the reference.
chapter - The current chapter
Returns:
The last valid verse number for a chapter If the book or chapter number is not valid

maximumOrdinal

@Deprecated
public static int maximumOrdinal()
Deprecated. use Versification.maximumOrdinal() instead

The maximum number of verses in the Bible, including module, testament, book and chapter introductions.

Returns:
the number of addressable verses in this versification.

getOrdinal

@Deprecated
public static int getOrdinal(Verse verse)
Deprecated. use Verse.getOrdinal() instead

Where does this verse come in the Bible. The value that this returns should be treated as opaque, useful for a bit set. The introductions to the Book, OT/NT Testaments, Bible books and chapters are included here.

Parameters:
verse - The verse to convert
Returns:
The ordinal number of verses

getTestamentOrdinal

@Deprecated
public static int getTestamentOrdinal(int ordinal)
Deprecated. use Versification.getTestamentOrdinal(int) instead

Where does this verse come in the Bible. The value that this returns should be treated as opaque, useful for a bit set. The introductions to the Book, OT/NT Testaments, Bible books and chapters are included here.

Parameters:
ordinal - The ordinal number of the Verse
Returns:
The ordinal number of the verse in its testament

getTestament

@Deprecated
public static Testament getTestament(int ordinal)
Deprecated. use Versification.getTestament(int) instead

Get the testament of a given verse


getCount

@Deprecated
public static int getCount(Testament testament)
Deprecated. use Versification.getCount(Testament) instead

Give the count of verses in the testament or the whole Bible.

Parameters:
testament - The testament to count. If null, then all testaments.
Returns:
the number of verses in the testament

decodeOrdinal

@Deprecated
public static Verse decodeOrdinal(int ordinal)
Deprecated. use Versification.decodeOrdinal(int) instead

Where does this verse come in the Bible. This will unwind the value returned by getOrdinal(Verse).

Parameters:
ordinal - The ordinal number of the verse
Returns:
A Verse
Throws:
NoSuchVerseException - If the reference is illegal

validate

@Deprecated
public static void validate(BibleBook book,
                                       int chapter,
                                       int verse)
                     throws NoSuchVerseException
Deprecated. use Versification.validate(BibleBook, int, int) instead

Does the following represent a real verse?. It is code like this that makes me wonder if I18 is done well/worth doing. All this code does is check if the numbers are valid, but the exception handling code is huge :(

Parameters:
book - The book part of the reference.
chapter - The chapter part of the reference.
verse - The verse part of the reference.
Throws:
NoSuchVerseException - If the reference is illegal

patch

@Deprecated
public static Verse patch(BibleBook book,
                                     int chapter,
                                     int verse)
Deprecated. use Versification.patch(BibleBook, int, int) instead

Fix up these verses so that they are as valid a possible. This is currently done so that we can say "Gen 1:1" + 31 = "Gen 1:32" and "Gen 1:32".patch() is "Gen 2:1".

There is another patch system that allows us to use large numbers to mean "the end of" so "Gen 1:32".otherPatch() gives "Gen 1:31". This could be useful to allow the user to enter things like "Gen 1:99" meaning the end of the chapter. Or "Isa 99:1" to mean the last chapter in Isaiah verse 1 or even "Rev 99:99" to mean the last verse in the Bible.

However I have not implemented this because I've used a different convention: "Gen 1:$" (OLB compatible) or "Gen 1:ff" (common commentary usage) to mean the end of the chapter - So the functionality is there anyway.

I think that getting into the habit of typing "Gen 1:99" is bad. It could be the source of surprises "Psa 119:99" is not what you'd might expect, and neither is "Psa 99:1" is you wanted the last chapter in Psalms - expecting us to type "Psa 999:1" seems like we're getting silly.

However despite this maybe we should provide the functionality anyway.

Parameters:
book - the book to obtain
chapter - the supposed chapter
verse - the supposed verse
Returns:
The resultant verse.

booksInBible

@Deprecated
public static int booksInBible()
Deprecated. use Versification.getBookCount() instead

Count the books in the Bible.

Returns:
The number of books in the Bible, including the three introductions

getBookName

@Deprecated
public static BookName getBookName(BibleBook book)
                            throws NoSuchVerseException
Deprecated. Use Versification#getBookName() instead.

Get the BookName. This is merely a convenience function that validates that book is not null, throwing NoSuchVerseException if it is.

Parameters:
book - The book of the Bible
Returns:
The requested BookName
Throws:
NoSuchVerseException - If the book is not valid

getBook

@Deprecated
public static BibleBook getBook(String find)
Deprecated. use Versification.getBook(String)

Get number of a book from its name.

Parameters:
find - The string to identify
Returns:
The BibleBook, On error null

isBookName

@Deprecated
public static boolean isBookName(String find)
Deprecated. use Versification.isBook(String)

Is the given string a valid book name. If this method returns true then getBook() will return a BibleBook and not throw an exception.

Parameters:
find - The string to identify
Returns:
true when the book name is recognized

chaptersInBible

@Deprecated
public static int chaptersInBible()
Deprecated. do not use

Count the chapters in the Bible.

Returns:
1189 always - the number of chapters in the Bible

versesInBible

@Deprecated
public static int versesInBible()
Deprecated. use maximumOrdinal()

The maximum number of verses in the Bible, including module, testament, book and chapter introductions. Note: it used to exclude introductions.

Returns:
the number of addressable verses in this versification.

getPreferredBookName

@Deprecated
public static String getPreferredBookName(BibleBook book)
                                   throws NoSuchVerseException
Deprecated. Use Versification.getPreferredName(BibleBook) instead.

Get the preferred name of a book. Altered by the case setting (see setBookCase() and isFullBookName()) This is merely a convenience function that validates that book is not null, throwing NoSuchVerseException if it is.

Parameters:
book - The book of the Bible
Returns:
The full name of the book
Throws:
NoSuchVerseException - If the book is not valid

getLongBookName

@Deprecated
public static String getLongBookName(BibleBook book)
                              throws NoSuchVerseException
Deprecated. Use Versification.getLongName(BibleBook) instead.

Get the full name of a book (e.g. "Genesis"). Altered by the case setting (see setBookCase()) This is merely a convenience function that validates that book is not null, throwing NoSuchVerseException if it is.

Parameters:
book - The book of the Bible
Returns:
The full name of the book
Throws:
NoSuchVerseException - If the book is not valid

getShortBookName

@Deprecated
public static String getShortBookName(BibleBook book)
                               throws NoSuchVerseException
Deprecated. Use Versification.getShortName(BibleBook) instead.

Get the short name of a book (e.g. "Gen"). Altered by the case setting (see setBookCase()) This is merely a convenience function that validates that book is not null, throwing NoSuchVerseException if it is.

Parameters:
book - The book of the Bible
Returns:
The short name of the book
Throws:
NoSuchVerseException - If the book is not valid

getOSISName

@Deprecated
public static String getOSISName(BibleBook book)
                          throws NoSuchVerseException
Deprecated. Use BibleBook.getOSIS() instead.

Get the OSIS name for a book. This is merely a convenience function that validates that book is not null, throwing NoSuchVerseException if it is.

Parameters:
book - The book of the Bible
Returns:
the OSIS defined short name for a book
Throws:
NoSuchVerseException - If the book is not valid

verseCount

@Deprecated
public static int verseCount(Verse verse1,
                                        Verse verse2)
                      throws NoSuchVerseException
Deprecated. Use + 1 instead.

How many verses between verse1 and verse2 (inclusive).

Parameters:
verse1 - The earlier verse.
verse2 - The later verse.
Returns:
the number of verses
Throws:
NoSuchVerseException - If either reference is illegal

setCase

@Deprecated
public static void setCase(int bookCase)
Deprecated. use BookName.setCase(int)

This is only used by config.

Parameters:
bookCase - The new case to use for reporting book names
Throws:
IllegalArgumentException - If the case is not between 0 and 2
See Also:
getCase()

getCase

@Deprecated
public static int getCase()
Deprecated. use BookName.getCase()

This is only used by config

Returns:
The current case setting
See Also:
setCase(CaseType)

setCase

@Deprecated
public static void setCase(CaseType newBookCase)
Deprecated. use BookName.setCase(CaseType)

How do we report the names of the books?. These are static. This is on the assumption that we will not want to have different sections of the app using a different format. I expect this to be a good assumption, and it saves passing a Book class around everywhere. CaseType.MIXED is not allowed

Parameters:
newBookCase - The new case to use for reporting book names
Throws:
IllegalArgumentException - If the case is not between 0 and 2
See Also:
getCase()

isFullBookName

@Deprecated
public static boolean isFullBookName()
Deprecated. use BookName.isFullBookName()

This is only used by config

Returns:
Whether the name is long or short. Default is Full (true).
See Also:
setFullBookName(boolean)

setFullBookName

@Deprecated
public static void setFullBookName(boolean fullName)
Deprecated. use BookName.setFullBookName(boolean)

Set whether the name should be full or abbreviated, long or short.

Parameters:
fullName - The new case to use for reporting book names
See Also:
isFullBookName()

getDefaultCase

@Deprecated
public static CaseType getDefaultCase()
Deprecated. use BookName.getDefaultCase()

How do we report the names of the books?.

Returns:
The current case setting
See Also:
setCase(int)

Copyright ? 2003-2011