org.robolectric.util.Scheduler.nextTaskIsScheduledBefore()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(178)

本文整理了Java中org.robolectric.util.Scheduler.nextTaskIsScheduledBefore()方法的一些代码示例,展示了Scheduler.nextTaskIsScheduledBefore()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Scheduler.nextTaskIsScheduledBefore()方法的具体详情如下:
包路径:org.robolectric.util.Scheduler
类名称:Scheduler
方法名:nextTaskIsScheduledBefore

Scheduler.nextTaskIsScheduledBefore介绍

暂无

代码示例

代码示例来源:origin: robolectric/robolectric

/**
 * Determine if any enqueued runnables are enqueued before the current time.
 *
 * @return  True if any runnables can be executed.
 */
public synchronized boolean areAnyRunnable() {
 return nextTaskIsScheduledBefore(currentTime);
}

代码示例来源:origin: robolectric/robolectric

/**
 * Run all runnables that are scheduled before the endTime.
 *
 * @param   endTime   Future time.
 * @return  True if a runnable was executed.
 */
public synchronized boolean advanceTo(long endTime) {
 if (endTime < currentTime || runnables.isEmpty()) {
  currentTime = endTime;
  return false;
 }
 int runCount = 0;
 while (nextTaskIsScheduledBefore(endTime)) {
  runOneTask();
  ++runCount;
 }
 currentTime = endTime;
 return runCount > 0;
}

代码示例来源:origin: org.robolectric/robolectric-utils

/**
 * Determine if any enqueued runnables are enqueued before the current time.
 *
 * @return  True if any runnables can be executed.
 */
public synchronized boolean areAnyRunnable() {
 return nextTaskIsScheduledBefore(currentTime);
}

代码示例来源:origin: org.robolectric/utils

/**
 * Determine if any enqueued runnables are enqueued before the current time.
 *
 * @return  True if any runnables can be executed.
 */
public synchronized boolean areAnyRunnable() {
 return nextTaskIsScheduledBefore(currentTime);
}

代码示例来源:origin: org.robolectric/utils

/**
 * Run all runnables that are scheduled before the endTime.
 *
 * @param   endTime   Future time.
 * @return  True if a runnable was executed.
 */
public synchronized boolean advanceTo(long endTime) {
 if (endTime < currentTime || runnables.isEmpty()) {
  currentTime = endTime;
  return false;
 }
 int runCount = 0;
 while (nextTaskIsScheduledBefore(endTime)) {
  runOneTask();
  ++runCount;
 }
 currentTime = endTime;
 return runCount > 0;
}

代码示例来源:origin: org.robolectric/robolectric-utils

/**
 * Run all runnables that are scheduled before the endTime.
 *
 * @param   endTime   Future time.
 * @return  True if a runnable was executed.
 */
public synchronized boolean advanceTo(long endTime) {
 if (endTime - currentTime < 0 || size() < 1) {
  currentTime = endTime;
  return false;
 }
 int runCount = 0;
 while (nextTaskIsScheduledBefore(endTime)) {
  runOneTask();
  ++runCount;
 }
 currentTime = endTime;
 return runCount > 0;
}

相关文章