I am having HashMap testmap;
Which is having data with multiple keys this way,
{
status = [1, 2, 3, 4, 5], data = [
[1, 2, 3, 4, 5, 6],
[7, 8 9, 10, 11, 12],
[13, 14 15, 16, 17, 18],
[19, 20, 21, 22, 23, 24],
[25, 26, 27, 28, 29, 30],
]
], warning = [
[1, 2, 3, 4, 5, 6],
[7, 8 9, 10, 11, 12],
[13, 14 15, 16, 17, 18],
[19, 20, 21, 22, 23, 24],
[25, 26, 27, 28, 29, 30],
], error = [1, 2, 3, 4, 5, 6], [7, 8 9, 10, 11, 12], [13, 14 15, 16, 17, 18], [19, 20, 21, 22, 23, 24], [25, 26, 27, 28, 29, 30],
}
I am trying to read the values from each key from the above map LIMIT by limit.
I.e, initially start limit =1 and end limit-3, then is should get only 1,2,3 values from each key of above hashmap.
Then if i send start limit =4 and end limit-6, then is hould get only 4,5,6 values form each key of above hashmap.
I tried this way,
Object firstKey = myHashMap.keySet().toArray()[3];
Object valueForFirstKey = myHashMap.get(firstKey);
//iterated the values from so getting
and got this way, [data = [1,2,3]]
Instead of this looping , can i get subset of values using both start and end index from hashmap for all the above keys like this?
if start index=1 and end index =3 it should return me output this way,
{
status = [1, 2, 3], data = [
[1, 2, 3],
[7, 8 9],
[13, 14 15],
[19, 20, 21],
[25, 26, 27],
]
], warning = [
[1, 2, 3, [7, 8 9],
[13, 14 15],
[19, 20, 21],
[25, 26, 27],
], error = [1, 2, 3],
[7, 8 9],
[13, 14 15],
[19, 20, 21],
[25, 26, 27],
}
without looping through each key and value as above? What mistake have I made?