I am having
Map<String, List<Attribute>> binList = new HashMap<String, List<Attribute>>();
I want to iterate through each values in list By doing this I am able to get the key and its entire values.But how to get each single value for a key.
BinList {3=[index=0 {from=1.3,to=2.42}, index=1 {from=2.42,to=3.54}, index=2 {from=3.54,to=4.66}, index=3 {from=4.66,to=5.78}, index=4 {from=5.78,to=6.9}], 2=[index=0 {from=2.3,to=2.76}, index=1 {from=2.76,to=3.2199999999999998}, index=2 {from=3.2199999999999998,to=3.6799999999999997}, index=3 {from=3.6799999999999997,to=4.14}, index=4 {from=4.14,to=4.6}], 1=[index=0 {from=4.3,to=5.02}, index=1 {from=5.02,to=5.739999999999999}, index=2 {from=5.739999999999999,to=6.459999999999999}, index=3 {from=6.459999999999999,to=7.179999999999999}, index=4 {from=7.179999999999999,to=7.899999999999999}], 4=[index=0 {from=0.3,to=0.76}, index=1 {from=0.76,to=1.2200000000000002}, index=2 {from=1.2200000000000002,to=1.6800000000000002}, index=3 {from=1.6800000000000002,to=2.14}, index=4 {from=2.14,to=2.6}]}
Map<String, List<Attribute>> binList = new HashMap<String, List<Attribute>>();
System.out.println("BinList "+binList);
//Iterating binList
while (it.hasNext()) {
Map.Entry pairs = (Map.Entry)it.next();
System.out.println("->>>>"+pairs.getKey() + " = " + pairs.getValue());
}
OUTPUT
->>>>3 = [index=0 {from=1.3,to=2.42}, index=1 {from=2.42,to=3.54}, index=2 {from=3.54,to=4.66}, index=3 {from=4.66,to=5.78}, index=4 {from=5.78,to=6.9}]
->>>>2 = [index=0 {from=2.3,to=2.76}, index=1 {from=2.76,to=3.2199999999999998}, index=2 {from=3.2199999999999998,to=3.6799999999999997}, index=3 {from=3.6799999999999997,to=4.14}, index=4 {from=4.14,to=4.6}]
->>>>1 = [index=0 {from=4.3,to=5.02}, index=1 {from=5.02,to=5.739999999999999}, index=2 {from=5.739999999999999,to=6.459999999999999}, index=3 {from=6.459999999999999,to=7.179999999999999}, index=4 {from=7.179999999999999,to=7.899999999999999}]
->>>>4 = [index=0 {from=0.3,to=0.76}, index=1 {from=0.76,to=1.2200000000000002}, index=2 {from=1.2200000000000002,to=1.6800000000000002}, index=3 {from=1.6800000000000002,to=2.14}, index=4 {from=2.14,to=2.6}]
How to iterate through values
id =3
index=0 {from=1.3,to=2.42}
index=1 {from=2.42,to=3.54}
.
.