MCPcopy Index your code
hub / github.com/davidgiven/luje / CheckedMap

Class CheckedMap

lib/java/util/Collections.java:3089–3504  ·  view source on GitHub ↗

Class represents a dynamically typesafe view of the specified map.

Source from the content-addressed store, hash-verified

3087 * Class represents a dynamically typesafe view of the specified map.
3088 */
3089 private static class CheckedMap<K, V> implements Map<K, V>, Serializable {
3090
3091 private static final long serialVersionUID = 5742860141034234728L;
3092
3093 Map<K, V> m;
3094
3095 Class<K> keyType;
3096
3097 Class<V> valueType;
3098
3099 /**
3100 * Constructs a dynamically typesafe view of the specified map.
3101 *
3102 * @param m -
3103 * the map for which a dynamically typesafe view is to be
3104 * constructed.
3105 */
3106 private CheckedMap(Map<K, V> m, Class<K> keyType, Class<V> valueType) {
3107 if (m == null || keyType == null || valueType == null) {
3108 throw new NullPointerException();
3109 }
3110 this.m = m;
3111 this.keyType = keyType;
3112 this.valueType = valueType;
3113 }
3114
3115 /**
3116 * @see java.util.Map#size()
3117 */
3118 public int size() {
3119 return m.size();
3120 }
3121
3122 /**
3123 * @see java.util.Map#isEmpty()
3124 */
3125 public boolean isEmpty() {
3126 return m.isEmpty();
3127 }
3128
3129 /**
3130 * @see java.util.Map#containsKey(Object)
3131 */
3132 public boolean containsKey(Object key) {
3133 return m.containsKey(key);
3134 }
3135
3136 /**
3137 * @see java.util.Map#containsValue(Object)
3138 */
3139 public boolean containsValue(Object value) {
3140 return m.containsValue(value);
3141 }
3142
3143 /**
3144 * @see java.util.Map#get(Object)
3145 */
3146 public V get(Object key) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected