public void addAll (ObjectSet<T> set) { ensureCapacity(set.size); for (T key : set) add(key); }
public void addAll (T[] array, int offset, int length) { ensureCapacity(length); for (int i = offset, n = i + length; i < n; i++) add(array[i]); }
public boolean add (T key) { if (!super.add(key)) return false; items.add(key); return true; }
public void addAll (T[] array, int offset, int length) { ensureCapacity(length); for (int i = offset, n = i + length; i < n; i++) add(array[i]); }
public boolean add (T key) { if (!super.add(key)) return false; items.add(key); return true; }
public void addAll (ObjectSet<T> set) { ensureCapacity(set.size); for (T key : set) add(key); }
/** Adds a region to the atlas. The texture for the specified region will be disposed when the atlas is disposed. */ public AtlasRegion addRegion (String name, TextureRegion textureRegion) { textures.add(textureRegion.texture); AtlasRegion region = new AtlasRegion(textureRegion); region.name = name; region.index = -1; regions.add(region); return region; }
/** Adds a region to the atlas. The texture for the specified region will be disposed when the atlas is disposed. */ public AtlasRegion addRegion (String name, TextureRegion textureRegion) { textures.add(textureRegion.texture); AtlasRegion region = new AtlasRegion(textureRegion); region.name = name; region.index = -1; regions.add(region); return region; }
/** Adds a region to the atlas. The specified texture will be disposed when the atlas is disposed. */ public AtlasRegion addRegion (String name, Texture texture, int x, int y, int width, int height) { textures.add(texture); AtlasRegion region = new AtlasRegion(texture, x, y, width, height); region.name = name; region.index = -1; regions.add(region); return region; }
/** Adds a region to the atlas. The specified texture will be disposed when the atlas is disposed. */ public AtlasRegion addRegion (String name, Texture texture, int x, int y, int width, int height) { textures.add(texture); AtlasRegion region = new AtlasRegion(texture, x, y, width, height); region.name = name; region.index = -1; regions.add(region); return region; }
synchronized void injectDependencies (String parentAssetFilename, Array<AssetDescriptor> dependendAssetDescs) { ObjectSet<String> injected = this.injected; for (AssetDescriptor desc : dependendAssetDescs) { if (injected.contains(desc.fileName)) continue; // Ignore subsequent dependencies if there are duplicates. injected.add(desc.fileName); injectDependency(parentAssetFilename, desc); } injected.clear(); }
public boolean add (T key, int index) { if (!super.add(key)) { items.removeValue(key, true); items.insert(index, key); return false; } items.insert(index, key); return true; }
public boolean add (T key, int index) { if (!super.add(key)) { items.removeValue(key, true); items.insert(index, key); return false; } items.insert(index, key); return true; }
synchronized void injectDependencies (String parentAssetFilename, Array<AssetDescriptor> dependendAssetDescs) { ObjectSet<String> injected = this.injected; for (AssetDescriptor desc : dependendAssetDescs) { if (injected.contains(desc.fileName)) continue; // Ignore subsequent dependencies if there are duplicates. injected.add(desc.fileName); injectDependency(parentAssetFilename, desc); } injected.clear(); }
atlas.getTextures().add(page.texture);
atlas.getTextures().add(page.texture);
texture.setWrap(page.uWrap, page.vWrap); textures.add(texture); pageToTexture.put(page, texture);
texture.setWrap(page.uWrap, page.vWrap); textures.add(texture); pageToTexture.put(page, texture);
@Override protected <E> boolean attribute (DefaultBehaviorTreeReader<E> reader, String name, Object value) { StackedTask<E> stackedTask = reader.getCurrentTask(); AttrInfo ai = stackedTask.metadata.attributes.get(name); if (ai == null) return false; boolean isNew = reader.encounteredAttributes.add(name); if (!isNew) throw reader.stackedTaskException(stackedTask, "attribute '" + name + "' specified more than once"); Field attributeField = reader.getField(stackedTask.task.getClass(), ai.fieldName); reader.setField(attributeField, stackedTask.task, value); return true; }
/** Inserts the specified element into this priority queue. If {@code uniqueness} is enabled and this priority queue already * contains the element, the call leaves the queue unchanged and returns false. * * @return true if the element was added to this queue, else false * @throws ClassCastException if the specified element cannot be compared with elements currently in this priority queue * according to the priority queue's ordering * @throws IllegalArgumentException if the specified element is null */ public boolean add (E e) { if (e == null) throw new IllegalArgumentException("Element cannot be null."); if (uniqueness && !set.add(e)) return false; int i = size; if (i >= queue.length) growToSize(i + 1); size = i + 1; if (i == 0) queue[0] = e; else siftUp(i, e); return true; }