1 package com.ibm.icu.dev.test.normalizer;
3 import java.util.HashMap;
7 *******************************************************************************
8 * Copyright (C) 2002-2010, International Business Machines Corporation and *
9 * Unicode, Inc. All Rights Reserved. *
10 *******************************************************************************
12 * Hashtable storing ints addressed by longs. Used
13 * for storing of composition data.
14 * @author Vladimir Weinstein
16 public class LongHashtable {
18 public LongHashtable (int defaultValue) {
19 this.defaultValue = defaultValue;
22 public void put(long key, int value) {
23 if (value == defaultValue) {
24 table.remove(new Long(key));
26 table.put(new Long(key), new Integer(value));
30 public int get(long key) {
31 Integer value = table.get(new Long(key));
32 if (value == null) return defaultValue;
33 return value.intValue();
36 private int defaultValue;
37 private Map<Long, Integer> table = new HashMap<Long, Integer>();