1 package com.ibm.icu.dev.test.normalizer;
\r
3 import java.util.Hashtable;
\r
6 *******************************************************************************
\r
7 * Copyright (C) 2002-2007, International Business Machines Corporation and *
\r
8 * Unicode, Inc. All Rights Reserved. *
\r
9 *******************************************************************************
\r
11 * Hashtable storing ints addressed by longs. Used
\r
12 * for storing of composition data. Uses Java Hashtable
\r
14 * @author Vladimir Weinstein
\r
16 public class LongHashtable {
\r
17 // static final String copyright = "Copyright (C) 2002-2003 International Business Machines Corporation and Unicode, Inc.";
\r
19 public LongHashtable (int defaultValue) {
\r
20 this.defaultValue = defaultValue;
\r
23 public void put(long key, int value) {
\r
24 if (value == defaultValue) {
\r
25 table.remove(new Long(key));
\r
27 table.put(new Long(key), new Integer(value));
\r
31 public int get(long key) {
\r
32 Object value = table.get(new Long(key));
\r
33 if (value == null) return defaultValue;
\r
34 return ((Integer)value).intValue();
\r
37 private int defaultValue;
\r
38 private Hashtable table = new Hashtable();
\r