I'm trying to put together a lookup mechanism that is regular expression based. For example


Map map = ...;


Bar bar = new Bar();

map.put("^http://foo.bar*",bar);


Bar bar2 = (Bar)map.get("http://foo.bar/bam";);



get("...") would return the bar object. Of course, this could match multiple values, as such get("...") could return the first value encountered or a Collection of all the matches encountered.


Collection bars = (Collection)map.get("http://foo.bar/bam";);
Iterator iter = bars.iterator();
Bar bar2 = (Bar)iter.next();

Any ideas on how I can throw this together using Commons Collections as a basis? I can live with just >=j2sdk1.4 compatibility. Is this something Commons Collections would like to have available?

-Mark
--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to