com.artemis.utils.Bag.addAll()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(102)

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

Bag.addAll介绍

[英]Add all items into this bag.
[中]把所有的东西都放进这个袋子里。

代码示例

代码示例来源:origin: junkdog/artemis-odb

/**
 * @return new instance of this builder.
 */
public Builder copy() {
  Builder b = new Builder();
  b.allTypes.addAll(allTypes);
  b.exclusionTypes.addAll(exclusionTypes);
  b.oneTypes.addAll(oneTypes);
  return b;
}

代码示例来源:origin: net.onedaybeard.artemis/artemis-odb

/**
 * @return new instance of this builder.
 */
public Builder copy() {
  Builder b = new Builder();
  b.allTypes.addAll(allTypes);
  b.exclusionTypes.addAll(exclusionTypes);
  b.oneTypes.addAll(oneTypes);
  return b;
}

代码示例来源:origin: junkdog/artemis-odb

/**
 * @return new instance of this builder.
 */
public Builder copy() {
  Builder b = new Builder();
  b.allTypes.addAll(allTypes);
  b.exclusionTypes.addAll(exclusionTypes);
  b.oneTypes.addAll(oneTypes);
  return b;
}

代码示例来源:origin: DaanVanYperen/artemis-odb-contrib

/** Safely delete all entities from bag, regardless if the bag changes. */
  public static void safeDeleteAll(final ImmutableBag<Entity> entities1) {
    final Bag<Entity> entities = new Bag<>();
    entities.addAll(entities1);
    for (int i = 0, s = entities.size(); i < s; i++) {
      entities.get(i).deleteFromWorld();
    }
  }
}

代码示例来源:origin: net.mostlyoriginal.artemis-odb/contrib-jam

/** Safely delete all entities from bag, regardless if the bag changes. */
  public static void safeDeleteAll(final ImmutableBag<Entity> entities1) {
    final Bag<Entity> entities = new Bag<>();
    entities.addAll(entities1);
    for (int i = 0, s = entities.size(); i < s; i++) {
      entities.get(i).deleteFromWorld();
    }
  }
}

代码示例来源:origin: net.mostlyoriginal.artemis-odb/contrib-components-libgdx

/** Safely delete all entities from bag, regardless if the bag changes. */
  public static void safeDeleteAll(final ImmutableBag<Entity> entities1) {
    final Bag<Entity> entities = new Bag<>();
    entities.addAll(entities1);
    for (int i = 0, s = entities.size(); i < s; i++) {
      entities.get(i).deleteFromWorld();
    }
  }
}

代码示例来源:origin: net.mostlyoriginal.artemis-odb/contrib-eventbus

/**
 * Get listeners for class, including all superclasses,
 * sorted by priority.
 *
 * Not backed by cache.
 *
 * @param aClass Class to fetch listeners for.
 * @return Bag of listeners, empty if none found.
 */
private Bag<EventListener> getListenersForHierarchicalUncached(Class<?> aClass) {
  // get hierarchy for event.
  final Class<?>[] classes = classHierarchy.of(aClass);
  // step through hierarchy back to front, fetching the listeners for each step.
  final Bag<EventListener> hierarchicalListeners = new Bag<>(4);
  for (Class<?> c : classes) {
    final Bag<EventListener> listeners = getListenersFor(c, false);
    if (listeners != null) {
      hierarchicalListeners.addAll(listeners);
    }
  }
  // sort by priority.
  BagUtils.sort(hierarchicalListeners);
  return hierarchicalListeners;
}

代码示例来源:origin: DaanVanYperen/artemis-odb-contrib

/**
 * Get listeners for class, including all superclasses,
 * sorted by priority.
 *
 * Not backed by cache.
 *
 * @param aClass Class to fetch listeners for.
 * @return Bag of listeners, empty if none found.
 */
private Bag<EventListener> getListenersForHierarchicalUncached(Class<?> aClass) {
  // get hierarchy for event.
  final Class<?>[] classes = classHierarchy.of(aClass);
  // step through hierarchy back to front, fetching the listeners for each step.
  final Bag<EventListener> hierarchicalListeners = new Bag<>(4);
  for (Class<?> c : classes) {
    final Bag<EventListener> listeners = getListenersFor(c, false);
    if (listeners != null) {
      hierarchicalListeners.addAll(listeners);
    }
  }
  // sort by priority.
  BagUtils.sort(hierarchicalListeners);
  return hierarchicalListeners;
}

相关文章