Link to home
Start Free TrialLog in
Avatar of kasiencja
kasiencjaFlag for Canada

asked on

Multidimensional hashmap or something alse array related.

I need something in Java that would allow me to set multidimentional arrays with the ability to set String values as both as keys  and as the value.  Also, I need to be able to check if the keys exists within one and two dimentions.  Something like.

myPlan[0][0] = "cell 1"
myPlan[0][1] = "cell 2"
myPlan[0][2] = "cell 3"
myPlan[1][0] = "cell 4"
myPlan[1][1] = "cell 5"
myPlan[1][2] = "cell 6"

than I need to be able to check if centerain keys exist for the first set/dimention, for example myPlan.containsKey(0), as well as for both dimentions myPlan.containsKey(0)(2).  I don't want to check for values it has to check if the keys exist, which at times may be Strings.

I'm not sure if HashMap is even the correct thing to use in this instance and I'm not familiar with Vectors to start figuring it out on my own.  

Thanks for your help and recommenations.
Kasia
Avatar of kasiencja
kasiencja
Flag of Canada image

ASKER

Hmm, I just looked over the code again and it looks like I might be able to get away with the key values being set to int only.
ASKER CERTIFIED SOLUTION
Avatar of petmagdy
petmagdy
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mick Barry