[jsword-devel] Passage constructors

DM Smith dmsmith at crosswire.org
Sat Feb 15 08:48:43 MST 2014


The Passage hierarchy has not allowed the creation of Passage objects except through a factory method that constructs all Passages according to a chosen default.

The exception was a TallyPassage, which was used by JSword's index search to create prioritized hit lists.

I've changed the default constructors to be public. These create an empty Passage of a given versification.

This now make it possible for a program that controls input to optimize passage construction for time/space.

The other constructors that take a string that needs to be parsed are still all protected. However, you can use the following to cast from one type of passage to another.

Key k = ...; This can be a Passage, VerseRange or Verse.
Passage p = RangedPassage(v11n);
p.addAll(k);

If you create a Verse or a VerseRange, you can add it to RangedPassage with add(k) rather than addAll(k).

In Him,
	DM
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4145 bytes
Desc: not available
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20140215/3c0c7f92/attachment.p7s>


More information about the jsword-devel mailing list