From 8b2577b77c6d26e6bbd09ce5ba2783de352310b5 Mon Sep 17 00:00:00 2001 From: Eric Scharff Date: Tue, 18 Dec 2007 11:23:59 -0700 Subject: [PATCH] Add method to create one hashtable from a map, useful in converting a HashMap into a Hashtable. --- classpath/java/util/Hashtable.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/classpath/java/util/Hashtable.java b/classpath/java/util/Hashtable.java index 6701ce49c8..620e9a074e 100644 --- a/classpath/java/util/Hashtable.java +++ b/classpath/java/util/Hashtable.java @@ -11,6 +11,13 @@ public class Hashtable implements Map { this(0); } + public Hashtable(Map m) { + this(m.size()); + for (Entry entry : m.entrySet()) { + put(entry.getKey(), entry.getValue()); + } + } + public String toString() { return map.toString(); }