[jsword-devel] Bible Desktop Notes

Joe Walker joseph.walker at gmail.com
Sat Aug 28 15:09:00 MST 2004


> >       [Passage] - How does each of the default
> > passage types affect the user?
> >
> >
> Don't know. I'll leave this for someone else to answer. If they don't
> I'll dig in the code to figure it out.

We had a fundamental interface Passage (these days Key is becoming
more important) Passage is a group of verses in the Bible (Key is more
generalized for a Book and not specific to a Bible) We also had to
classes Verse (obvious) and VerseRange (for example Gen 1:1-5)

When I came to implement Passage I wasn't sure if it was best to make
it a collection of Verses or VerseRanges so I did both and called them
DistinctPassage and RangedPassage. It then occured to me that we could
have an implementation that was a bit array, one bit for each verse in
the Bible, so BitwisePassage was born.
I tested them for speed and found the correct answer depended on what
you were doing, so I created RocketPassage that attempted to be a
mixture of DistinctPassage and BitwisePassage and would choose the
fastest method.

The selection of the "correct" passage should not be a user option,
but I could imagine that there are times when a developer might want
to alter the default for some reason.

(For the train-spotters amongst you, Passage was originally called
Reference until Reference became an important JDK class - that why you
generally find instances of Passage called ref and not psg or similar)

Joe.


More information about the jsword-devel mailing list