1 16 package org.apache.cocoon.faces.context; 17 18 import java.util.Map ; 19 import java.util.Set ; 20 21 27 abstract class BaseMap extends java.util.AbstractMap { 28 29 static class Entry implements Map.Entry { 30 private final Object key; 31 private final Object value; 32 33 Entry(Object key, Object value) { 34 this.key = key; 35 this.value = value; 36 } 37 38 public Object getKey() { 39 return key; 40 } 41 42 public Object getValue() { 43 return value; 44 } 45 46 public Object setValue(Object value) { 47 throw new UnsupportedOperationException (); 48 } 49 50 public int hashCode() { 51 return (key != null ? key.hashCode() : 0) ^ (value != null ? value.hashCode() : 0); 52 } 53 54 public boolean equals(Object obj) { 55 if (obj == null || !(obj instanceof Map.Entry )) { 56 return false; 57 } 58 59 Map.Entry other = (Map.Entry ) obj; 60 Object key = other.getKey(); 61 if (key == this.key || key != null && key.equals(this.key)) { 62 Object value = other.getValue(); 63 return value == this.value || value != null && value.equals(this.value); 64 } 65 return false; 66 } 67 } 68 69 70 BaseMap() { 71 } 72 73 public void clear() { 74 throw new UnsupportedOperationException (); 75 } 76 77 public void putAll(Map t) { 78 throw new UnsupportedOperationException (); 79 } 80 81 public Object remove(Object key) { 82 throw new UnsupportedOperationException (); 83 } 84 85 public Set entrySet() { 86 throw new UnsupportedOperationException (); 87 } 88 } 89 | Popular Tags |