1 8 9 package com.sleepycat.collections; 10 11 import java.util.Map ; 12 13 29 public class MapEntryParameter implements Map.Entry { 30 31 private Object key; 32 private Object value; 33 34 41 public MapEntryParameter(Object key, Object value) { 42 43 this.key = key; 44 this.value = value; 45 } 46 47 53 public int hashCode() { 54 55 return ((key == null) ? 0 : key.hashCode()) ^ 56 ((value == null) ? 0 : value.hashCode()); 57 } 58 59 65 public boolean equals(Object other) { 66 67 if (!(other instanceof Map.Entry )) { 68 return false; 69 } 70 71 Map.Entry e = (Map.Entry ) other; 72 73 return ((key == null) ? (e.getKey() == null) 74 : key.equals(e.getKey())) && 75 ((value == null) ? (e.getValue() == null) 76 : value.equals(e.getValue())); 77 } 78 79 84 public final Object getKey() { 85 86 return key; 87 } 88 89 96 public final Object getValue() { 97 98 return value; 99 } 100 101 105 public Object setValue(Object newValue) { 106 107 throw new UnsupportedOperationException (); 108 } 109 110 final void setValueInternal(Object newValue) { 111 112 this.value = newValue; 113 } 114 115 120 public String toString() { 121 122 return "[key [" + key + "] value [" + value + ']'; 123 } 124 } 125 126 | Popular Tags |