kasiencja
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER