[jsword-devel] Finding which books are in a Bible module
Chris Burrell
christopher at burrell.me.uk
Mon May 20 09:39:59 MST 2013
Hi Martin
>From memory, essentially, the following method was optimized:
book.getGlobalKeyList();
That means the following code is much faster. (There are probably other
scenarios too).
final Key keyToBook = book.getValidKey(v11n.getShortName(bb));
keyToBook.retainAll(this.globalKeyList);
if (keyToBook.getCardinality() == 0) {
return;
}
I was after getGlobalKeyList in particular to generate links to each
chapter in each available book. Obviously, this is a slightly different use
case for working out if a particular key exists... But it should do the
trick, so long as you're happy with the fact it reads the entire first
index file.
Chris
On 20 May 2013 16:53, Martin Denham <mjdenham at gmail.com> wrote:
> Could somebody point me to the new code, recently mentioned on sword-devel
> that finds which books are actually in a Bible module e.g. for TDavid it
> would return ['Ps'].
>
> Thanks
> Martin
>
> _______________________________________________
> jsword-devel mailing list
> jsword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/jsword-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20130520/d1f8f899/attachment.html>
More information about the jsword-devel
mailing list