2 *******************************************************************************
\r
3 * Copyright (C) 2009, International Business Machines Corporation and *
\r
4 * others. All Rights Reserved. *
\r
5 *******************************************************************************
\r
7 package com.ibm.icu.dev.test.util;
\r
9 import java.util.Map;
\r
15 public class ImmutableEntry<K,V> implements Map.Entry<K,V> {
\r
19 ImmutableEntry(K key, V value) {
\r
24 public K getKey() {return k;}
\r
26 public V getValue() {return v;}
\r
28 public V setValue(V value) {
\r
29 throw new UnsupportedOperationException();
\r
32 public boolean equals(Object o) {
\r
34 Map.Entry e = (Map.Entry)o;
\r
35 return UnicodeMap.areEqual(e.getKey(), k) && UnicodeMap.areEqual(e.getValue(), v);
\r
36 } catch (ClassCastException e) {
\r
41 public int hashCode() {
\r
42 return ((k==null ? 0 : k.hashCode()) ^ (v==null ? 0 : v.hashCode()));
\r
45 public String toString() {
\r