コード例 #1
0
ファイル: Widget.java プロジェクト: lcy03406/amber
  public void tick(double dt) throws InterruptedException {
    Widget next;

    for (Widget wdg = child; wdg != null; wdg = next) {
      next = wdg.next;
      wdg.tick(dt);
    }
    /* It would be very nice to do these things in harmless mix-in
     * classes, but alas, this is Java. */
    anims.addAll(nanims);
    nanims.clear();
    for (Iterator<Anim> i = anims.iterator(); i.hasNext(); ) {
      Anim anim = i.next();
      if (anim.tick(dt)) i.remove();
    }
  }
コード例 #2
0
ファイル: Widget.java プロジェクト: lcy03406/amber
 public <T extends Anim> void clearanims(Class<T> type) {
   for (Iterator<Anim> i = nanims.iterator(); i.hasNext(); ) {
     Anim a = i.next();
     if (type.isInstance(a)) i.remove();
   }
   for (Iterator<Anim> i = anims.iterator(); i.hasNext(); ) {
     Anim a = i.next();
     if (type.isInstance(a)) i.remove();
   }
 }
コード例 #3
0
  private boolean verifyTestMethodsInJUnit38TestClassThatShouldRun(JUnit38ClassRunner runner) {
    Description testClassDescription = runner.getDescription();
    Class<?> testClass = testClassDescription.getTestClass();
    Iterator<Description> itr = testClassDescription.getChildren().iterator();

    while (itr.hasNext()) {
      Description testDescription = itr.next();
      String testMethodName = testDescription.getMethodName();
      testMethod = findPublicVoidMethod(testClass, testMethodName);

      Boolean shouldRun = shouldRunTestInCurrentTestRun(null, testMethod);

      if (shouldRun != null && !shouldRun) {
        itr.remove();
      }
    }

    return testClassDescription.getChildren().isEmpty();
  }