01: /*
02: *******************************************************************************
03: * Copyright (C) 2002-2005, International Business Machines Corporation and *
04: * others. All Rights Reserved. *
05: *******************************************************************************
06: */
07: package com.ibm.icu.dev.tool.localeconverter;
08:
09: import java.util.*;
10:
11: public class LocaleConverter {
12: public Hashtable convert(Hashtable table) throws ConversionError {
13: Hashtable result = new Hashtable();
14: convert(result, table);
15: return result;
16: }
17:
18: protected void convert(Hashtable result, Hashtable source)
19: throws ConversionError {
20: Enumeration enumer = source.keys();
21: while (enumer.hasMoreElements()) {
22: String key = (String) enumer.nextElement();
23: Object data = source.get(key);
24: result.put(key, data);
25: }
26: }
27:
28: public static class ConversionError extends Exception {
29: public ConversionError() {
30: }
31:
32: public ConversionError(String reason) {
33: super(reason);
34: }
35: }
36: }
|