OK,
Let me start again,
I am creating a hashmap dynamically and need to pass two parameter to a function
1st parameter :- is the Value of the latest put in Hashmap.
2nd parameter :- is the Key of the previous Value.
If we see the example again I have
{KEY1,VALUE1}
{KEY2,VALUE2}
{KEY3,VALUE3}
SO, I want to call
function(VALUE2,KEY1)
If Hashmap is not the correct choice , then could you please let me know the best option.
Thanks.
why don't you just store the items into "temporary" objects
like:
// let's say we have Object latestValue and keyOfPreviousValue
map.put(key, value);
latestValue = value;
function(latestValue, keyOfPreviousValue);
keyOfPreviousValue = key;
notice that latestValue is not necessary with such a structure
> Yeah, and I want the head of Amy Winehouse on the body of Scarlett Johansen.
I forced that out for the sake of analogy. Scarlett has the face of an angel on the body of a stripper.
[url #" style="display: block; background-image: url('http://bksc.dyndns.org/Homer_Simpson.jpg'); width: 80px; height: 80px] [/url]
> Hi All,
>
>I have created a Hashmap with 3 values
>map.put(1,value1);
> map.put(2,value2);
>map.put(3,value3);
> I want to fetch VALUE of Key "2" with KEY
> of "value1"
>
> Thanks.
Why, may I ask, would you want this?
What (in a slightly larger scope) are you trying to accomplish?