Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String filter = (fill(tileXY[1], 6) + PIPE + fill(tileXY[0], 6));
- // attenzione
- Result result = getCurrent(filter);
- if(result!=null)
- {
- NavigableMap<byte[], byte[]>result_map = result.getFamilyMap("I".getBytes());
- // Per ogni sezione che interseca la tile
- for(byte[] column : result_map.keySet())
- {
- String col = Bytes.toString(column);
- String[] split = col.split("\\|");
- float perc = Float.parseFloat(Bytes.toString(result.getValue("I".getBytes(), column)));
- // SEZIONE (160101|SEZ|01|001|001|000|0000001)
- String rkSez = key.day.toString() + "|SEZ|" + split[0] + "|" + split[1] + "|" + split[2] + "|" + split[3] + "|" + split[5];
- if(map.containsKey(rkSez))
- map.put(rkSez, map.get(rkSez) + (tempValue*perc));
- else
- {
- map.put(rkSez, tempValue*perc);
- context.getCounter(OnBilStatistics.NumOfSez).increment(1);
- }
- // SEZIONE DETTAGLIATA (160101|SEC|01|001|001|000|000|0000001)
- String rkSec = key.day.toString() + "|SEC|" + col;
- if(map.containsKey(rkSec))
- map.put(rkSec, map.get(rkSec) + (tempValue*perc));
- else
- {
- map.put(rkSec, tempValue*perc);
- context.getCounter(OnBilStatistics.NumOfSez).increment(1);
- }
- // AREA CENSUARIA (160101|ACE|01|001|001|000|001)
- String rkAce = key.day.toString() + "|ACE|" + split[0] + "|" + split[1] + "|" + split[2] + "|" + split[3] + "|" + split[4];
- if(map.containsKey(rkAce))
- map.put(rkAce, map.get(rkAce) + (tempValue*perc));
- else
- map.put(rkAce, tempValue*perc);
- // ASC, se è diverso da 0 (160101|ASC|01|001|001|001)
- if(Integer.parseInt(split[3]) > 0)
- {
- String rkAsc = key.day.toString() + "|ASC|" + split[0] + "|" + split[1] + "|" + split[2] + "|" + split[3];
- if(map.containsKey(rkAsc))
- map.put(rkAsc, map.get(rkAsc) + (tempValue*perc));
- else
- map.put(rkAsc, tempValue*perc);
- }
- // COMUNE (160101|COM|01|001|001)
- String rkCom = key.day.toString() + "|COM|" + split[0] + "|" + split[1] + "|" + split[2];
- if(map.containsKey(rkCom))
- map.put(rkCom, map.get(rkCom) + (tempValue*perc));
- else
- map.put(rkCom, tempValue*perc);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement