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

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

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

Bag.isEmpty介绍

[英]Returns true if this bag contains no elements.
[中]

代码示例

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

/**
 * Sort bag.
 * Entities must implement Sortable.
 *
 * Be aware that bags require a resort when you
 * remove entries.
 */
public static void sort(Bag bag) {
  if ( !bag.isEmpty() ) {
    Arrays.sort(bag.getData(), 0, bag.size());
  }
}

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

/**
 * Sort bag.
 * Entities must implement Sortable.
 *
 * Be aware that bags require a resort when you
 * remove entries.
 */
public static void sort(Bag bag) {
  if ( !bag.isEmpty() ) {
    Arrays.sort(bag.getData(), 0, bag.size());
  }
}

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

private EntityEdit entityEdit() {
  if (pool.isEmpty()) {
    return new EntityEdit(world);
  } else {
    return pool.removeLast();
  }
}

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

private EntityEdit entityEdit() {
  if (pool.isEmpty()) {
    return new EntityEdit(world);
  } else {
    return pool.removeLast();
  }
}

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

/**
 * Gets free object from pool or creates a new one if there are no free objects.
 * 
 * @see #free(Object)
 */
public T obtain() {
  T obj = !pool.isEmpty()
    ? pool.remove(pool.size() - 1)
    : instantiateObject();
  
  return obj;
}

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

/**
 * Gets free object from pool or creates a new one if there are no free objects.
 * 
 * @see #free(Object)
 */
public T obtain() {
  T obj = !pool.isEmpty()
    ? pool.remove(pool.size() - 1)
    : instantiateObject();
  
  return obj;
}

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

@Override
  public void onCreated(ComponentType type) {
    Bag<LinkSite> links = linkFactory.create(type);
    if (links.isEmpty())
      return;
    for (int i = 0, s = links.size(); s > i; i++) {
      elm.linkSites.add(links.get(i));
    }
  }
}

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

@Override
  public void onCreated(ComponentType type) {
    Bag<LinkSite> links = linkFactory.create(type);
    if (links.isEmpty())
      return;
    for (int i = 0, s = links.size(); s > i; i++) {
      elm.linkSites.add(links.get(i));
    }
  }
}

相关文章