Advertisement
Guest User

Untitled

a guest
Jan 21st, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.17 KB | None | 0 0
  1. String filter = (fill(tileXY[1], 6) + PIPE + fill(tileXY[0], 6));
  2.         // attenzione
  3.         Result result = getCurrent(filter);
  4.         if(result!=null)
  5.         {
  6.             NavigableMap<byte[], byte[]>result_map = result.getFamilyMap("I".getBytes());
  7.  
  8.             // Per ogni sezione che interseca la tile
  9.             for(byte[] column : result_map.keySet())
  10.             {
  11.                 String col = Bytes.toString(column);
  12.                 String[] split = col.split("\\|");
  13.                 float perc = Float.parseFloat(Bytes.toString(result.getValue("I".getBytes(), column)));
  14.  
  15.                 // SEZIONE (160101|SEZ|01|001|001|000|0000001)
  16.                 String rkSez = key.day.toString() + "|SEZ|" + split[0] + "|" + split[1] + "|" + split[2] + "|" + split[3] + "|" + split[5];
  17.                 if(map.containsKey(rkSez))
  18.                     map.put(rkSez, map.get(rkSez) + (tempValue*perc));
  19.                 else
  20.                 {
  21.                     map.put(rkSez, tempValue*perc);
  22.                     context.getCounter(OnBilStatistics.NumOfSez).increment(1);
  23.                 }
  24.  
  25.                 // SEZIONE DETTAGLIATA (160101|SEC|01|001|001|000|000|0000001)
  26.                 String rkSec = key.day.toString() + "|SEC|" + col;
  27.                 if(map.containsKey(rkSec))
  28.                     map.put(rkSec, map.get(rkSec) + (tempValue*perc));
  29.                 else
  30.                 {
  31.                     map.put(rkSec, tempValue*perc);
  32.                     context.getCounter(OnBilStatistics.NumOfSez).increment(1);
  33.                 }
  34.  
  35.                 // AREA CENSUARIA (160101|ACE|01|001|001|000|001)
  36.                 String rkAce = key.day.toString() + "|ACE|" + split[0] + "|" + split[1] + "|" + split[2] + "|" + split[3] + "|" + split[4];
  37.                 if(map.containsKey(rkAce))
  38.                     map.put(rkAce, map.get(rkAce) + (tempValue*perc));
  39.                 else
  40.                     map.put(rkAce, tempValue*perc);
  41.  
  42.  
  43.                 // ASC, se è diverso da 0 (160101|ASC|01|001|001|001)
  44.                 if(Integer.parseInt(split[3]) > 0)
  45.                 {
  46.                     String rkAsc = key.day.toString() + "|ASC|" + split[0] + "|" + split[1] + "|" + split[2] + "|" + split[3];
  47.                     if(map.containsKey(rkAsc))
  48.                         map.put(rkAsc, map.get(rkAsc) + (tempValue*perc));
  49.                     else
  50.                         map.put(rkAsc, tempValue*perc);
  51.                 }
  52.  
  53.                 // COMUNE (160101|COM|01|001|001)
  54.                 String rkCom = key.day.toString() + "|COM|" + split[0] + "|" + split[1] + "|" + split[2];
  55.                 if(map.containsKey(rkCom))
  56.                     map.put(rkCom, map.get(rkCom) + (tempValue*perc));
  57.                 else
  58.                     map.put(rkCom, tempValue*perc);
  59.  
  60.             }
  61.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement