I am new to this area, so please excuse my stupid mistakes :) So, the problem I am facing: On my webpage I am showing a table. At the moment, my problem is with the three columns of the table.
First is : Area Code
Second is : Zone Code
Third is: Value
The relationship between the three:
1 The area code has 6 different area codes, and all these area codes have a corresponding “Value” value. I need a data structure that gives me the flexibility to get a “value” for the area code that matches a specific area code.
I have the same zone codes for all zone codes:
Zone codes are: 111, 222, 333, 444, 555, 666
After surfing your stackoverflow, I thought I could go with this structure:
Map<Integer, Map<Integer, Double>> retailPrices = new HashMap<Integer, Map<Integer, Double>>();
Map<Integer, Double> codes = new HashMap<Integer, Double>();
where reatailPrices will contain the area code and area code as the key and "value" as the value.
SQL, :
put(Integer, Map<Integer,Double>)
Map<Integer,Map<Integer,Double>> (Integer, Double)
:
while(oResult.next())
retailPrices.put((new Integer(oResult.getString("AREA"))), (codes.put(new Integer(oResult.getString("ZONE_CODE")), new Double(oResult.getString("VALUE")))));
}
, . ?