本文整理汇总了Java中edu.mit.media.funf.time.TimeUtil.getTimestamp方法的典型用法代码示例。如果您正苦于以下问题:Java TimeUtil.getTimestamp方法的具体用法?Java TimeUtil.getTimestamp怎么用?Java TimeUtil.getTimestamp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.mit.media.funf.time.TimeUtil
的用法示例。
在下文中一共展示了TimeUtil.getTimestamp方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDataReceived
import edu.mit.media.funf.time.TimeUtil; //导入方法依赖的package包/类
@Override
public void onDataReceived(IJsonObject completeProbeUri, IJsonObject data) {
Log.d(LogUtil.TAG, "SimpleLocationProbe received data: " + data.toString());
if (startTime == null) {
startTime = TimeUtil.getTimestamp();
getHandler().postDelayed(sendLocationRunnable, TimeUtil.secondsToMillis(maxWaitTime));
}
if (isBetterThanCurrent(data)) {
Log.d(LogUtil.TAG, "SimpleLocationProbe evaluated better location.");
bestLocation = data;
}
if (goodEnoughAccuracy != null && bestLocation.get(ACCURACY).getAsDouble() < goodEnoughAccuracy.doubleValue()) {
Log.d(LogUtil.TAG, "SimpleLocationProbe evaluated good enough location.");
if (getState() == State.RUNNING) { // Actively Running
stop();
} else if (getState() == State.ENABLED) { // Passive listening
// TODO: do we want to prematurely end this, or wait for the full duration
// Things to consider:
// - the device falling to sleep before we send
// - too much unrequested data if we send all values within accuracy limits
// (this will restart immediately if more passive data continues to come in)
getHandler().removeCallbacks(sendLocationRunnable);
sendCurrentBestLocation();
}
}
}
示例2: onStart
import edu.mit.media.funf.time.TimeUtil; //导入方法依赖的package包/类
@Override
protected void onStart() {
super.onStart();
Log.d(LogUtil.TAG, "SimpleLocationProbe starting, registering listener");
startTime = TimeUtil.getTimestamp();
locationProbe.registerListener(listener);
getHandler().sendMessageDelayed(getHandler().obtainMessage(STOP_MESSAGE), TimeUtil.secondsToMillis(maxWaitTime));
}
示例3: run
import edu.mit.media.funf.time.TimeUtil; //导入方法依赖的package包/类
@Override
public void run() {
if (am != null) {
List<RecentTaskInfo> currentTasks = am.getRecentTasks(1, ActivityManager.RECENT_WITH_EXCLUDED);
if (!currentTasks.isEmpty()) {
RecentTaskInfo updatedTask = currentTasks.get(0);
if (currentRunningTask == null || !currentRunningTask.baseIntent.filterEquals(updatedTask.baseIntent)) {
endCurrentTask();
currentRunningTask = updatedTask;
currentRunningTaskStartTime = TimeUtil.getTimestamp();
}
}
getHandler().postDelayed(this, TimeUtil.secondsToMillis(pollInterval));
}
}
示例4: getNextTime
import edu.mit.media.funf.time.TimeUtil; //导入方法依赖的package包/类
public BigDecimal getNextTime(Number previousTime) {
if (interval == null) {
return null;
} else if (previousTime == null) {
return TimeUtil.getTimestamp();
} else {
return DecimalTimeUnit.decimal(previousTime).add(interval);
}
}
示例5: generateName
import edu.mit.media.funf.time.TimeUtil; //导入方法依赖的package包/类
@Override
public String generateName(final String name) {
return name == null ? null : TimeUtil.getTimestamp() + "_" + name;
}
开发者ID:chauhansaurabhb,项目名称:EndUserInteractioion_RequestResponse_Command,代码行数:5,代码来源:NameGenerator.java