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