Please refer to the following method :
public Set getCellsInColumn(String columnIndex){
Map cellsMap = getCell
You're getting the set of keys in the map, then using each key to get the value out of the map.
Instead, you can simply iterate through the Map.Entry key/value pairs returned to you via entrySet()
. That way you avoid the relatively expensive get()
lookup (note the use of the word relatively here)
e.g.
for (Map.Entry e : map.entrySet()) {
// do something with...
e.getKey();
e.getValue();
}