|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.jsword.book.BookData
public class BookData
BookData is the assembler of the OSIS that is returned by the filters. As such it puts that into an OSIS document. When several books are supplied, it gets the data from each and puts it into a parallel or interlinear view. Note: it is critical that all the books are able to understand the same key. That does not mean that each has to have content for each key. Missing keys are represented by empty cells.
The GNU Lesser General Public License for details.
Nested Class Summary | |
---|---|
(package private) class |
BookData.BookVerseContent
A temporary holder for a map that links each verse ID to its set of OSIS elements. |
Field Summary | |
---|---|
private Book[] |
books
The books to which the key should be applied. |
private boolean |
comparingBooks
Whether the Books should be compared. |
private org.jdom2.Element |
fragment
Just the element |
private Key |
key
What key was used to create this data |
private org.jdom2.Element |
osis
The complete OSIS container for the element |
private UnAccenter |
unaccenter
|
Constructor Summary | |
---|---|
BookData(Book[] books,
Key key,
boolean compare)
Create BookData for multiple books. |
|
BookData(Book book,
Key key)
Create a BookData. |
Method Summary | |
---|---|
private void |
addContentSafely(org.jdom2.Element cell,
List<org.jdom2.Content> xmlContent)
JDOM will throw an exception if we try and add the content to multiple parents. |
private boolean |
addHeaderAndSetShowDiffsState(org.jdom2.Element row,
boolean[] showDiffs,
int i,
boolean ommittedVerse)
|
private void |
addText(boolean doDiffs,
StringBuilder newText,
org.jdom2.Content content)
Adds the text to the diff buffer |
private void |
addText(boolean doDiffs,
StringBuilder newText,
List<org.jdom2.Content> contents)
Loops around contents and calls addText for a single element |
private org.jdom2.Element |
appendVersificationNotice(org.jdom2.Element parent,
String notice)
Creates a notice element. |
Book[] |
getBooks()
Who created this data. |
Book |
getFirstBook()
Get the first book. |
Key |
getKey()
The key used to obtain data from one or more books. |
org.jdom2.Element |
getOsis()
Accessor for the root OSIS element |
private org.jdom2.Element |
getOsisContent(boolean allowGenTitles)
|
org.jdom2.Element |
getOsisFragment()
Accessor for the requested data in OSIS format. |
org.jdom2.Element |
getOsisFragment(boolean allowGenTitles)
Accessor for the root OSIS element |
SAXEventProvider |
getSAXEventProvider()
Output the current data as a SAX stream. |
private Versification |
getVersification(int i)
|
boolean |
isComparingBooks()
|
private BookData.BookVerseContent |
keyIteratorContentByVerse(Versification v11n,
Iterator<org.jdom2.Content> iter)
We iterate through the content, making sure we key together those bits that belong together. |
void |
setUnaccenter(UnAccenter unaccenter)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Key key
private Book[] books
private boolean comparingBooks
private org.jdom2.Element osis
private org.jdom2.Element fragment
private UnAccenter unaccenter
Constructor Detail |
---|
public BookData(Book book, Key key)
book
- the Book to which the data belongskey
- the Key specifying the datapublic BookData(Book[] books, Key key, boolean compare)
books
- the set of Books to which the data belongskey
- the Key specifying the datacompare
- when true each pair of adjacent books is to be comparedMethod Detail |
---|
public org.jdom2.Element getOsis() throws BookException
BookException
- if there is any problem with this requestpublic org.jdom2.Element getOsisFragment() throws BookException
BookException
- if there is any problem with this requestpublic org.jdom2.Element getOsisFragment(boolean allowGenTitles) throws BookException
allowGenTitles
- whether to generate titles
BookException
- if there is any problem with this requestpublic SAXEventProvider getSAXEventProvider() throws BookException
BookException
- if there is any problem with this requestpublic Book[] getBooks()
getBooks
in interface BookProvider
public Book getFirstBook()
getFirstBook
in interface BookProvider
public Key getKey()
public boolean isComparingBooks()
private org.jdom2.Element getOsisContent(boolean allowGenTitles) throws BookException
BookException
private void addContentSafely(org.jdom2.Element cell, List<org.jdom2.Content> xmlContent)
cell
- the element to be addedxmlContent
- the collector of contentprivate org.jdom2.Element appendVersificationNotice(org.jdom2.Element parent, String notice)
parent
- the parent to which the notice is addednotice
- the notice fragment to be applied to the sub-type
private Versification getVersification(int i)
i
- the current position in the array of books
private BookData.BookVerseContent keyIteratorContentByVerse(Versification v11n, Iterator<org.jdom2.Content> iter) throws BookException
v11n
- the versification for the contentiter
- the iterator of OSIS content
BookException
- if there is any problem with this requestprivate boolean addHeaderAndSetShowDiffsState(org.jdom2.Element row, boolean[] showDiffs, int i, boolean ommittedVerse)
row
- our current OSIS rowshowDiffs
- the array of states as to whether we are showing diffs for this columni
- our current place in the stateommittedVerse
- true to indicate this column will be ommiting a verse
private void addText(boolean doDiffs, StringBuilder newText, List<org.jdom2.Content> contents)
doDiffs
- true for calculating differencesnewText
- the newText buffer used to compare one portion of text to anothercontents
- the contents to be addedprivate void addText(boolean doDiffs, StringBuilder newText, org.jdom2.Content content)
doDiffs
- true for calculating differencesnewText
- the newText buffer used to compare one portion of text to anothercontent
- the content element to be addedpublic void setUnaccenter(UnAccenter unaccenter)
unaccenter
- the unaccenter to set
|
Copyright ยจ 2003-2015 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |