/** * Set the date/time the message was sent to the channel. * * @param date * The date/time the message was sent to the channel. */ public void setDate(Time date) { if (!date.equals(m_date)) { m_date.setTime(date.getTime()); } } // setDate
/** * Set the date/time the message was sent to the channel. * * @param date * The date/time the message was sent to the channel. */ public void setDate(Time date) { if (!date.equals(m_date)) { m_date.setTime(date.getTime()); } } // setDate
/** * Set the date/time the message was sent to the channel. * * @param date * The date/time the message was sent to the channel. */ public void setDate(Time date) { if (!date.equals(m_date)) { m_date.setTime(date.getTime()); } } // setDate
/** * Enlarge or shrink the time range by multiplying a zooming factor * * @param f * zooming factor */ public void zoom(double f) { long oldRange = m_endTime.getTime() - m_startTime.getTime(); long center = m_startTime.getTime() + oldRange / 2; long newRange = (long) ((double) oldRange * f); m_startTime.setTime(center - newRange / 2); m_endTime.setTime(center + newRange / 2); }
/** * what is the first time range included? * * @param fudge * How many ms to advance if the first is not included. * @return the first time actually in the range */ public Time firstTime(long fudge) { // if the start is included, return this if (m_startIncluded) { return m_startTime; } // if not, return a time one ms after start Time fudgeStartTime = (Time) m_startTime.clone(); fudgeStartTime.setTime(m_startTime.getTime() + fudge); return fudgeStartTime; } // firstTime
/** * what is the last time range included? * * @param fudge * How many ms to decrease if the first is not included. * @return the last time actually in the range */ public Time lastTime(long fudge) { // if the end is included, return this if (m_endIncluded) { return m_endTime; } // if not, return a time one ms before end Time fudgeEndTime = (Time) m_endTime.clone(); fudgeEndTime.setTime(m_endTime.getTime() - fudge); return fudgeEndTime; } // lastTime
/** * Adjust this time range based on the difference between the origRange and the modRange, if any * * @param original * the original time range. * @param modified * the modified time range. */ public void adjust(TimeRange original, TimeRange modified) { if (original.equals(modified)) return; // adjust for the change in the start time m_startTime.setTime(m_startTime.getTime() + (((MyTimeRange) modified).m_startTime.getTime() - ((MyTimeRange) original).m_startTime.getTime())); // adjust for the change in the end time m_endTime.setTime(m_endTime.getTime() + (((MyTimeRange) modified).m_endTime.getTime() - ((MyTimeRange) original).m_endTime.getTime())); } // adjust