1 package com.ibm.icu.dev.test.normalizer;
\r
3 import java.util.Hashtable;
\r
6 *******************************************************************************
\r
7 * Copyright (C) 1998-2007, International Business Machines Corporation and *
\r
8 * Unicode, Inc. All Rights Reserved. *
\r
9 *******************************************************************************
\r
11 * Integer-String hash table. Uses Java Hashtable for now.
\r
12 * @author Mark Davis
\r
15 public class IntStringHashtable {
\r
16 // static final String copyright = "Copyright (C) 1998-2003 International Business Machines Corporation and Unicode, Inc.";
\r
18 public IntStringHashtable (String defaultValue) {
\r
19 this.defaultValue = defaultValue;
\r
22 public void put(int key, String value) {
\r
23 if (value == defaultValue) {
\r
24 table.remove(new Integer(key));
\r
26 table.put(new Integer(key), value);
\r
30 public String get(int key) {
\r
31 Object value = table.get(new Integer(key));
\r
32 if (value == null) return defaultValue;
\r
33 return (String)value;
\r
36 private String defaultValue;
\r
37 private Hashtable table = new Hashtable();
\r