if (logger.isDebugEnabled()) { logger.debug(">>Computing Clock Interval start hr= "+t); }
    public static ClockInterval[] generateIntervals(Calendar startTime, Calendar endTime, int intervalLength) {                        int endHr = endTime.get(Calendar.HOUR_OF_DAY);        int finalMin = endTime.get(Calendar.MINUTE);        int startHr = startTime.get(Calendar.HOUR_OF_DAY);        int startMin = startTime.get(Calendar.MINUTE);        if (finalMin > 0 && (startHr != endHr ) ) { // extends into next hr, so we need to add another interval            intervalLength++;        }                //Build up array of clockIntervals to compare against        ClockInterval[] clockIntervals = new ClockInterval[intervalLength]; //in case it's less than an hour!                //Init        //# of minutes in the first hour's interval, e.g. startTime = 1815, endMin = 45 minutes        int sMin = 0;        int eMin = 0;         GregorianCalendar tempTime = (GregorianCalendar)startTime.clone();        //Populate the interval        int t = startHr;        for (int i=0; i< intervalLength; i++) {                        sMin = 0; //default start minute            eMin = 60; //default end minute                        if (i == 0) {                 sMin = startMin; //starting minute the first hour's interval                                 //e.g. startTime = 1815, sMin = 15 minutes            }            //no ELSE here -- it could be both the first AND last interval            //Check if this is the last interval             if (i == (intervalLength - 1 ) ) {                 eMin = finalMin; //ending minute in the last hour's interval                                 //e.g. endTime = 1845, startMin = 45 minutes            }            clockIntervals[i] = new ClockInterval(t, sMin, eMin);            tempTime.add(Calendar.HOUR_OF_DAY, 1); //add one hour            t = tempTime.get(Calendar.HOUR_OF_DAY);        }                return clockIntervals;    }        