if (logger.isDebugEnabled()) { logger.debug("start time = "+startTime.toString() + ", endTime = "+endTime.toString()); }
if (logger.isDebugEnabled()) { logger.debug("endTime - startTime = "+ durHrs + " hours (truncated)"); }
    public double computeIntervalProbability(long start, long end) throws NegativeIntervalException {                 if (intervals.size() == 0 && infiniteIntervalProbability == null) {             if (logger.isDebugEnabled()) { logger.debug("No intervals, returning 0.0"); }            return 0.0;         } // no probability                //break interval up into minutes        long interval = end - start;        if (interval < 0) {            throw new NegativeIntervalException();        } else if (interval == 0) {            if (logger.isDebugEnabled()) { logger.debug("Interval length is 0, returning 0.0"); }            return 0.0; //zero length interval        }        //Convert millisecond interval to minutes, round up, & cast to int.        int durationInMins = (int) java.lang.Math.ceil( (interval / 60000) );                        //See if there is an infinite interval probability. If so, we don't need to break up        //the entire interval into sub-intervals.        if (infiniteIntervalProbability != null) {            double pr = infiniteIntervalProbability.computeIntervalProbability(durationInMins);            if (logger.isDebugEnabled()) { logger.debug("Infinite interval, called infiniteIntervalProbability.computeIntervalProbability(). Prob = "+pr); }                        return pr;        }                GregorianCalendar startTime = new GregorianCalendar(TimeZone.getTimeZone("GMT"));        startTime.setTimeInMillis(start);                GregorianCalendar endTime = (GregorianCalendar)startTime.clone();        endTime.add(Calendar.MINUTE, durationInMins); // find ending time        int durHrs = durationInMins / 60;                if (logger.isDebugEnabled()) { logger.debug("start time = "+startTime.toString() + ", endTime = "+endTime.toString()); }                                    ClockInterval[] clockIntervals = ClockInterval.generateIntervals(startTime, endTime, durHrs);                if (logger.isDebugEnabled()) { logger.debug("Number of clock intervals = "+ clockIntervals.length ); }                            //Otherwise figure out how many interval probabilities will be used.        EventProbabilityInterval epi;        double cumulativeProb = 1.0;        Iterator i = intervals.iterator();        while (i.hasNext()) {                        epi = (EventProbabilityInterval) i.next();            int minutes = ClockInterval.computeOverlap(clockIntervals, epi.getClockIntervals() );            double prob = epi.computeIntervalProbability(minutes);            if (logger.isDebugEnabled()) { logger.debug("Minutes in interval="+minutes+", prob = "+prob); }                                    cumulativeProb = cumulativeProb * prob;        }        if (logger.isDebugEnabled()) { logger.debug("Returning prob of ="+(1.0-cumulativeProb)); }                            return 1.0 - cumulativeProb;    }