From 710d86d31cd278583ee3d74b36595f4148a72133 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 5 Jun 2010 00:03:49 +0200 Subject: Minor additions to nio/Buffers, util/IntIntHashMap and os/NativeLibrary Buffers add 'float[] getFloatArray(double[])' conversion, ready to replace all JOGL InternalBufferUtil's. NativeLibrary/DynamicLinker add global lookup method allowing Unices and OSX to lookup a symbol globally. However, this is not recommended, due to the lookup costs. Windows is not supported here. Primitive type HashMap's (IntIntHashMap): Added putAll() --- src/java/com/jogamp/common/util/IntIntHashMap.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/java/com/jogamp/common/util') diff --git a/src/java/com/jogamp/common/util/IntIntHashMap.java b/src/java/com/jogamp/common/util/IntIntHashMap.java index aa739b4..9e2b3bc 100644 --- a/src/java/com/jogamp/common/util/IntIntHashMap.java +++ b/src/java/com/jogamp/common/util/IntIntHashMap.java @@ -176,6 +176,18 @@ public class /*name*/IntIntHashMap/*name*/ implements Iterable { return keyNotFoundValue; } + /** + * Copies all of the mappings from the specified map to this map. + */ +// @SuppressWarnings(value="cast") + public void putAll(/*name*/IntIntHashMap/*name*/ source) { + Iterator itr = source.iterator(); + while(itr.hasNext()) { + Entry e = (Entry) itr.next(); + put(e.key, e.value); + } + } + /** * Removes the key-value mapping from this map. * Returns the previously mapped value or {@link #getKeyNotFoundValue} if no such mapping exists. -- cgit v1.2.3