@Override public IntMap<T> clone(){ try{ IntMap<T> clone = (IntMap<T>) super.clone(); Entry[] newTable = new Entry[table.length]; for (int i = table.length - 1; i >= 0; i--){ if (table[i] != null) newTable[i] = table[i].clone(); } clone.table = newTable; return clone; }catch (CloneNotSupportedException ex){ } return null; }
return (T) oldValue; table[index] = new Entry(key, value, table[index]); if (size++ >= threshold){
return (T) oldValue; table[index] = new Entry(key, value, table[index]); if (size++ >= threshold){
if (mesh != null) { for (Entry<VertexBuffer> entry : mesh.getBuffers()) { VertexBuffer buf = entry.getValue(); if (buf.getData() != null) { renderer.updateBufferData(buf);
VertexBuffer vb = entry.getValue(); if (vb == null || vb.getBufferType() == Type.Index) continue;
buffersList.add(entry.getValue());
buffersList.add(entry.getValue());
/** * Merge two fonts. * If two font have the same style, merge will fail. * @param styleSet Style must be assigned to this. * @author Yonghoon */ public void merge(BitmapCharacterSet styleSet) { if (this.renderedSize != styleSet.renderedSize) { throw new RuntimeException("Only support same font size"); } for (Entry<IntMap<BitmapCharacter>> entry : styleSet.characters) { int style = entry.getKey(); if (style == 0) { throw new RuntimeException("Style must be set first. use setStyle(int)"); } IntMap<BitmapCharacter> charset = entry.getValue(); this.lineHeight = Math.max(this.lineHeight, styleSet.lineHeight); IntMap<BitmapCharacter> old = this.characters.put(style, charset); if (old != null) { throw new RuntimeException("Can't override old style"); } for (Entry<BitmapCharacter> charEntry : charset) { BitmapCharacter ch = charEntry.getValue(); ch.setPage(ch.getPage() + this.pageSize); } } this.pageSize += styleSet.pageSize; }
/** * Merge two fonts. * If two font have the same style, merge will fail. * @param styleSet Style must be assigned to this. * @author Yonghoon */ public void merge(BitmapCharacterSet styleSet) { if (this.renderedSize != styleSet.renderedSize) { throw new RuntimeException("Only support same font size"); } for (Entry<IntMap<BitmapCharacter>> entry : styleSet.characters) { int style = entry.getKey(); if (style == 0) { throw new RuntimeException("Style must be set first. use setStyle(int)"); } IntMap<BitmapCharacter> charset = entry.getValue(); this.lineHeight = Math.max(this.lineHeight, styleSet.lineHeight); IntMap<BitmapCharacter> old = this.characters.put(style, charset); if (old != null) { throw new RuntimeException("Can't override old style"); } for (Entry<BitmapCharacter> charEntry : charset) { BitmapCharacter ch = charEntry.getValue(); ch.setPage(ch.getPage() + this.pageSize); } } this.pageSize += styleSet.pageSize; }
protected void writeIntSavableMap(IntMap<? extends Savable> array) throws IOException { if (array == null) { write(NULL_OBJECT); return; } write(array.size()); int[] keys = new int[array.size()]; Savable[] values = new Savable[keys.length]; int i = 0; for (Entry<? extends Savable> entry : array){ keys[i] = entry.getKey(); values[i] = entry.getValue(); i++; } // write String array for keys write(keys); // write Savable array for values write(values); }
public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); oc.write(c, "c", 0); oc.write(x, "x", 0); oc.write(y, "y", 0); oc.write(width, "width", 0); oc.write(height, "height", 0); oc.write(xOffset, "xOffset", 0); oc.write(yOffset, "yOffset", 0); oc.write(xAdvance, "xAdvance", 0); int[] seconds = new int[kerning.size()]; int[] amounts = new int[seconds.length]; int i = 0; for (Entry<Integer> entry : kerning){ seconds[i] = entry.getKey(); amounts[i] = entry.getValue(); i++; } oc.write(seconds, "seconds", null); oc.write(amounts, "amounts", null); }
public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); oc.write(c, "c", 0); oc.write(x, "x", 0); oc.write(y, "y", 0); oc.write(width, "width", 0); oc.write(height, "height", 0); oc.write(xOffset, "xOffset", 0); oc.write(yOffset, "yOffset", 0); oc.write(xAdvance, "xAdvance", 0); int[] seconds = new int[kerning.size()]; int[] amounts = new int[seconds.length]; int i = 0; for (Entry<Integer> entry : kerning){ seconds[i] = entry.getKey(); amounts[i] = entry.getValue(); i++; } oc.write(seconds, "seconds", null); oc.write(amounts, "amounts", null); }