1 package com.ibm.icu.dev.test.normalizer;
3 import java.util.HashMap;
8 *******************************************************************************
9 * Copyright (C) 1998-2010, International Business Machines Corporation and *
10 * Unicode, Inc. All Rights Reserved. *
11 *******************************************************************************
13 * Integer-String hash table. Uses Java Hashtable for now.
17 public class IntStringHashtable {
19 public IntStringHashtable (String defaultValue) {
20 this.defaultValue = defaultValue;
23 public void put(int key, String value) {
24 if (value == defaultValue) {
25 table.remove(new Integer(key));
27 table.put(new Integer(key), value);
31 public String get(int key) {
32 String value = table.get(new Integer(key));
33 if (value == null) return defaultValue;
37 private String defaultValue;
38 private Map<Integer, String> table = new HashMap<Integer, String>();