Returns the value of the mapping with the specified key. @param key the key. @return the value of the mapping with the specified key, or null if no mapping for the specified key is found.
(Object key)
| 165 | * if no mapping for the specified key is found. |
| 166 | */ |
| 167 | public V get(Object key) { |
| 168 | Iterator<Map.Entry<K, V>> it = entrySet().iterator(); |
| 169 | if (key != null) { |
| 170 | while (it.hasNext()) { |
| 171 | Map.Entry<K, V> entry = it.next(); |
| 172 | if (key.equals(entry.getKey())) { |
| 173 | return entry.getValue(); |
| 174 | } |
| 175 | } |
| 176 | } else { |
| 177 | while (it.hasNext()) { |
| 178 | Map.Entry<K, V> entry = it.next(); |
| 179 | if (entry.getKey() == null) { |
| 180 | return entry.getValue(); |
| 181 | } |
| 182 | } |
| 183 | } |
| 184 | return null; |
| 185 | } |
| 186 | |
| 187 | /** |
| 188 | * Returns the hash code for this object. Objects which are equal must |