void updateDayCounter(final long newMessages){
  GregorianCalendar cal=new GregorianCalendar();
  int currentIndex=cal.get(Calendar.HOUR_OF_DAY);
  boolean bUpdate=false;
  for (int i=0; i <= currentIndex; i++) {
    if (counters[i] > -1) {
      bUpdate=true;
    }
    if (bUpdate == true) {
      if (counters[i] == -1) {
        counters[i]=0;
      }
    }
  }
  counters[currentIndex]+=newMessages;
}

void updateDayCounter ( final long newMessages ) { GregorianCalendar cal = new GregorianCalendar ( ) ; int currentIndex = cal . get ( Calendar . HOUR_OF_DAY ) ; boolean bUpdate = false ; for ( int i = 0 ; i <= currentIndex ; i ++ ) { if ( counters [ i ] > - 1 ) { bUpdate = true ; } if ( bUpdate == true ) { if ( counters [ i ] == - 1 ) { counters [ i ] = 0 ; } } } counters [ currentIndex ] += newMessages ; }
update day counter hour array elements
