|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.crosswire.jsword.versification.Versification
public class Versification
A named Versification defines the order of BibleBooks by Testament, the number of chapters in each BibleBook, the number of verses in each chapter.
for license details.
The copyright to this program is held by it's authors.,
Serialized Form| Field Summary | |
|---|---|
private BibleBookList |
bookList
|
private int[][] |
chapterStarts
Constant for the ordinal number of the first verse in each chapter. |
private int[][] |
lastVerse
Constant for the max verse number in each chapter |
private String |
name
The OSIS name of the reference system. |
private int |
ntMaxOrdinal
The last ordinal number of the New Testament and the maximum ordinal number of this Reference System |
private int |
otMaxOrdinal
The last ordinal number of the Old Testament |
private static long |
serialVersionUID
Serialization ID |
| Constructor Summary | |
|---|---|
Versification()
|
|
Versification(String name,
BibleBook[] booksOT,
BibleBook[] booksNT,
int[][] lastVerseOT,
int[][] lastVerseNT)
Construct a Versification. |
|
| Method Summary | |
|---|---|
Verse |
add(Verse verse,
int n)
Get the verse that is a few verses on from the one we've got. |
boolean |
adjacentTo(Verse first,
Verse second)
Is this verse adjacent to another verse |
Verse |
decodeOrdinal(int ordinal)
Where does this verse come in the Bible. |
int |
distance(Verse start,
Verse end)
How many verses are there in between the 2 Verses. |
static void |
dump(PrintStream out,
String name,
BibleBookList bookList,
int[][] array)
|
VerseRange |
getAllVerses()
Get a VerseRange encompassing this Versification. |
int |
getBookCount(Verse start,
Verse end)
How many books in this range |
BibleBookList |
getBooks()
|
int |
getChapterCount(Verse start,
Verse end)
How many chapters in this range |
int |
getCount(Testament testament)
Give the count of verses in the testament or the whole Bible. |
Verse |
getFirstVerseInBook(Verse verse)
Create a new Verse being the first verse in the current book |
Verse |
getFirstVerseInChapter(Verse verse)
Create a new Verse being the first verse in the current book |
int |
getLastChapter(BibleBook book)
Get the last valid chapter number for a book. |
int |
getLastVerse(BibleBook book,
int chapter)
Get the last valid verse number for a chapter. |
Verse |
getLastVerseInBook(Verse verse)
Create a new Verse being the last verse in the current book |
Verse |
getLastVerseInChapter(Verse verse)
Create a new Verse being the last verse in the current book |
String |
getName()
Get the OSIS name for this Versification. |
int |
getOrdinal(Verse verse)
Where does this verse come in the Bible. |
Testament |
getTestament(int ordinal)
Get the testament of a given verse |
int |
getTestamentOrdinal(int ordinal)
Where does this verse come in the Bible. |
boolean |
isEndOfBook(Verse verse)
Is this verse the last in the book |
boolean |
isEndOfChapter(Verse verse)
Is this verse the first in a chapter |
boolean |
isSameBook(Verse a,
Verse b)
Is this verse in the same book as that one |
boolean |
isSameChapter(Verse a,
Verse that)
Is this verse in the same chapter as that one |
boolean |
isStartOfBook(Verse verse)
Is this verse the first in a chapter |
boolean |
isStartOfChapter(Verse verse)
Is this verse the first in a chapter |
Verse |
max(Verse a,
Verse b)
Determine the later of the two verses. |
int |
maximumOrdinal()
The maximum number of verses in the Bible, including module, testament, book and chapter introductions. |
Verse |
min(Verse a,
Verse b)
Determine the earlier of the two verses. |
static void |
optimize(PrintStream out,
BibleBookList bookList,
int[][] lastVerse)
|
Verse |
patch(BibleBook book,
int chapter,
int verse)
Fix up these verses so that they are as valid a possible. |
Verse |
subtract(Verse verse,
int n)
Get the verse n down from here this Verse. |
void |
validate(BibleBook book,
int chapter,
int verse)
Does the following represent a real verse?. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private String name
private BibleBookList bookList
private int otMaxOrdinal
private int ntMaxOrdinal
private int[][] lastVerse
private int[][] chapterStarts
private static final long serialVersionUID
| Constructor Detail |
|---|
public Versification()
public Versification(String name,
BibleBook[] booksOT,
BibleBook[] booksNT,
int[][] lastVerseOT,
int[][] lastVerseNT)
name - The name of this reference systembooksOT - An ordered list of books in this reference system. The list
should not include INTRO_BIBLE, or INTRO_OT.booksNT - An ordered list of books in this reference system. The list
should not include INTRO_NT.lastVerseOT - For each book in booksOT, this has an array with one entry for
each chapter whose value is the highest numbered verse in that
chapter. Do not include chapter 0.lastVerseNT - For each book in booksNT, this has an array with one entry for
each chapter whose value is the highest numbered verse in that
chapter. Do not include chapter 0.| Method Detail |
|---|
public String getName()
public BibleBookList getBooks()
public int getLastChapter(BibleBook book)
book - The book part of the reference.
public int getLastVerse(BibleBook book,
int chapter)
book - The book part of the reference.chapter - The current chapter
public VerseRange getAllVerses()
public Verse getLastVerseInBook(Verse verse)
public Verse getLastVerseInChapter(Verse verse)
public Verse getFirstVerseInBook(Verse verse)
public Verse getFirstVerseInChapter(Verse verse)
public boolean isStartOfChapter(Verse verse)
public boolean isEndOfChapter(Verse verse)
public boolean isStartOfBook(Verse verse)
public boolean isEndOfBook(Verse verse)
public boolean isSameChapter(Verse a,
Verse that)
that - The verse to compare to
public boolean isSameBook(Verse a,
Verse b)
a - The verse to compare tob - The verse to compare to
public boolean adjacentTo(Verse first,
Verse second)
first - The first verse in the comparisonsecond - The second verse in the comparison
public int distance(Verse start,
Verse end)
distance(gen11, gen12) == 1
start - The first Verse in the rangeend - The last Verse in the range
public Verse min(Verse a,
Verse b)
a - the first verse to compareb - the second verse to compare
public Verse max(Verse a,
Verse b)
a - the first verse to compareb - the second verse to compare
public Verse subtract(Verse verse,
int n)
n - The number to count down by
public Verse add(Verse verse,
int n)
n - the number of verses later than the one we're one
public int getChapterCount(Verse start,
Verse end)
public int getBookCount(Verse start,
Verse end)
public int maximumOrdinal()
public int getOrdinal(Verse verse)
verse - The verse to convert
public int getTestamentOrdinal(int ordinal)
verse - The verse to convert
public Testament getTestament(int ordinal)
public int getCount(Testament testament)
testament - The testament to count. If null, then all testaments.
public Verse decodeOrdinal(int ordinal)
ordinal - The ordinal number of the verse
public void validate(BibleBook book,
int chapter,
int verse)
throws NoSuchVerseException
book - The book part of the reference.chapter - The chapter part of the reference.verse - The verse part of the reference.
NoSuchVerseException - If the reference is illegal
public Verse patch(BibleBook book,
int chapter,
int verse)
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.
book - the book to obtainchapter - the supposed chapterverse - the supposed verse
public static void dump(PrintStream out,
String name,
BibleBookList bookList,
int[][] array)
public static void optimize(PrintStream out,
BibleBookList bookList,
int[][] lastVerse)
|
Copyright ? 2003-2011 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||