本文整理了Java中org.sakaiproject.time.api.Time.setTime()
方法的一些代码示例,展示了Time.setTime()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Time.setTime()
方法的具体详情如下:
包路径:org.sakaiproject.time.api.Time
类名称:Time
方法名:setTime
[英]Set the time in milliseconds since.
[中]以毫秒为单位设置自。
代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl
/**
* Shift the time range back an intervel
*
* @param i
* time intervel in ms
*/
public void shiftBackward(long i)
{
m_startTime.setTime(m_startTime.getTime() - i);
m_endTime.setTime(m_endTime.getTime() - i);
}
代码示例来源:origin: sakaiproject/sakai
/**
* 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
代码示例来源:origin: org.sakaiproject.message/sakai-message-util
/**
* 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
代码示例来源:origin: org.sakaiproject.message/sakai-message-impl
/**
* 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
代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl
/**
* Shift the time range forward an intervel
*
* @param i
* time intervel in ms
*/
public void shiftForward(long i)
{
m_startTime.setTime(m_startTime.getTime() + i);
m_endTime.setTime(m_endTime.getTime() + i);
}
代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl
/**
* 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);
}
代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl
/**
* 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
代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl
/**
* 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
代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl
/**
* 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
内容来源于网络,如有侵权,请联系作者删除!