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 hash table. Uses Java Hashtable for now.
\r
12 * @author Mark Davis
\r
15 public class IntHashtable {
\r
16 // static final String copyright = "Copyright (C) 1998-2003 International Business Machines Corporation and Unicode, Inc.";
\r
18 public IntHashtable (int defaultValue) {
\r
19 this.defaultValue = defaultValue;
\r
22 public void put(int key, int value) {
\r
23 if (value == defaultValue) {
\r
24 table.remove(new Integer(key));
\r
26 table.put(new Integer(key), new Integer(value));
\r
30 public int get(int key) {
\r
31 Object value = table.get(new Integer(key));
\r
32 if (value == null) return defaultValue;
\r
33 return ((Integer)value).intValue();
\r
36 private int defaultValue;
\r
37 private Hashtable table = new Hashtable();
\r