Re: How can i implements a class like an HashMap but with 2 keys ?



Roedy Green wrote:
On Tue, 28 Aug 2007 14:02:21 +0200, Rob <nomail@nomail> wrote, quoted
or indirectly quoted someone who said :

i am a newbie, i want to create a class that works like an HashMap but
with 2 keys, get(key1,key2) -> value
....
3. concatenate your two String keys into one.

I'd avoid this one unless there is at least one char bit pattern that
cannot appear in the first input, to use as separator.

For example, using "_" for the separator, the key "A_B_C" would be used
for both ("A_B","C") and ("A","B_C"), making it impossible to
distinguish those pairs.

This can be worked around by an encoding step before the concatenation,
but that makes it all more complicated, and simplicity is the main merit
of this method.

Patricia

.



Relevant Pages

  • Re: Melodic Minor Chords and Chord-Scale Relationships
    ... be used as the basis for composition  and improvisation have merit in your ... Keys and modes, ... are from melodic minor, harmonic minor or natural minor, um... ...
    (rec.music.makers.guitar.jazz)
  • Re: Merit force 2005.5 keys
    ... People sell keys all the time. ... Merit will send you the CDs for free if you are an operator. ... they will just die during shipping. ... I've bought games that were working, ...
    (rec.games.video.arcade.collecting)
  • Re: Best simple phone for a 70 year old?
    ... but simplicity and ease of use are obviously paramount. ... needs to be a reasonable size, big keys, simple menus. ...
    (uk.telecom.mobile)
  • Re: KeyPress event cancel
    ... TextBox (just for simplicity it only suppresses Up and Down keys, but you can modify it for your needs). ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Best simple phone for a 70 year old?
    ... but simplicity and ease of use are obviously paramount. ... needs to be a reasonable size, big keys, simple menus. ...
    (uk.telecom.mobile)