[sword-devel] Multimap (was: I want to port the API to Java)

Mike Dougherty sword-devel@crosswire.org
06 Dec 2001 23:34:36 -0800

On Thu, 2001-12-06 at 19:53, Troy A. Griffitts wrote:
> the issue is more with something like:
> [KJV]
> DataPath=./modules/texts/rawtext/kjv/
> ModDrv=RawText
> SourceType=GBF
> Lang=en
> GlobalOptionFilter=GBFFootnotes
> GlobalOptionFilter=GBFStrongs
> GlobalOptionFilter=GBFMorph
> in c++, I can:
> SWMgr *manager = new SWMgr();
> string modDrv = (*manager->config)["KJV"]["ModDrv"];
> and, (this is the multimap stuff):
> for (ConfigEntMap::iterator it =
> (*manager->config)["KJV"].lower_bound("GlobalOptionFilter");
>     it != (*manager->config)["KJV"].upper_bound("GlobalOptionFilter");
>     it++) {
>   // do whatever with *it;
> }

OK, I think I am (finally) getting it. Little bit of a language barrier
there for to begin with... get it language barrier... C++ -> Java ;-) 

OK maybe it is a little late... why do I feel like I am the only one

> I don't believe a Properties object, nor a HashMap object allow
> duplicate key values.  You can correct me if I'm wrong.  I don't mind
> using the jgl library.  I'm sure we'll end up using other 3rd party libs
> before things are thru.

You are right, the HashMap and Properties objects that are provided do
not support duplicate values for a name. But I don't think it would take
much to enhance them to get what is needed (subclass the Properties
object adding a getProperties(String) method that returns an Iterator).
And personally I would prefer to use the core libraries if at all
possible (helps the app maintain portability).

Not that I dislike JGL, I really don't know anything about it. I went
and looked at the site and didn't really find much in the way of API
documentation. I also couldn't find any licensing requirements. Will we
even be able to bundle it with Sword?

In the end if it's decided that JGL's mutimap is the best way to go then
that's what I'll use. I just want to make sure the other options we
thought out and considered.


 Mike Dougherty -- Java Software Engineer
 Some people carve careers, others chisel them.