At 04:19 AM 2/12/2004, you wrote:
Navjot,
I believe this is exactly what Guillermo CLEARLY stated he had already tried (and is not efficient enough for him).
If you had taken a little bit longer and read carefully, then maybe you'd have noticed.
Regards, Freddy.
-----Mensaje original----- De: Navjot Singh [mailto:[EMAIL PROTECTED] Enviado el: jueves, 12 de febrero de 2004 13:14 Para: Struts Users Mailing List; [EMAIL PROTECTED] Asunto: RE: [OT] Case insensitive Map keys
yes. here it is.
public CIMap extends HashMap {
public Object get(String key) { return super.get(key.toLowerCase()); }
public Object put(String key, Object value) { super.put(key.toLowerCase(),value); } }
This was simple implementation. By the time you ask the Q and wait for reply. you could have written on your own.
Navjot Singh
>-----Original Message----- >From: Guillermo Meyer [mailto:[EMAIL PROTECTED] >Sent: Thursday, February 12, 2004 5:24 PM >To: 'Struts Users Mailing List' >Subject: [OT] Case insensitive Map keys > > >Hi: >Does anyone know an implementation of Map where keys are String and case >insensitive? >I want to do this: > >map.put("propertyName", "DATA"); > >And then, I should be able to get the value like this: >Object obj = map.get("PROPERTYNAME"); > >Or like this: >Object obj = map.get("propertyname"); //or whatever. case insensitive. > >We tried using toUppercase when putting and toUppercase when getting, >and using equalsIgnoreCase but this is not as efficient as we need. >May there be a way to calculate a hash for strings in upper or lower >case to result in the same value? > >Thanks in advance. > >Guillermo. > > >NOTA DE CONFIDENCIALIDAD >Este mensaje (y sus anexos) es confidencial, esta dirigido >exclusivamente a las personas direccionadas en el mail y puede >contener informacion (i)de propiedad exclusiva de Interbanking >S.A. o (ii) amparada por el secreto profesional. Cualquier opinion >en el contenido, es exclusiva de su autor y no representa >necesariamente la opinion de Interbanking S.A. El acceso no >autorizado, uso, reproduccion, o divulgacion esta prohibido. >Interbanking S.A no asumira responsabilidad ni obligacion legal >alguna por cualquier informacion incorrecta o alterada contenida >en este mensaje. Si usted ha recibido este mensaje por error, le >rogamos tenga la amabilidad de destruirlo inmediatamente junto con >todas las copias del mismo, notificando al remitente. No debera >utilizar, revelar, distribuir, imprimir o copiar este mensaje ni >ninguna de sus partes si usted no es el destinatario. Muchas gracias. >
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]