1 22 package org.jboss.xb.util; 23 24 import java.util.AbstractMap ; 25 import java.util.Collection ; 26 import java.util.Collections ; 27 import java.util.Map ; 28 import java.util.Set ; 29 30 34 public class NoopMap 35 extends AbstractMap 36 { 37 public static final Map INSTANCE = new NoopMap(); 38 39 public Object put(Object key, Object value) 40 { 41 return null; 42 } 43 44 public int size() 45 { 46 return 0; 47 } 48 49 public boolean isEmpty() 50 { 51 return true; 52 } 53 54 public boolean containsKey(Object key) 55 { 56 return false; 57 } 58 59 public boolean containsValue(Object value) 60 { 61 return false; 62 } 63 64 public Object get(Object key) 65 { 66 return null; 67 } 68 69 public Set keySet() 70 { 71 return Collections.EMPTY_SET; 72 } 73 74 public Collection values() 75 { 76 return Collections.EMPTY_SET; 77 } 78 79 public Set entrySet() 80 { 81 return Collections.EMPTY_SET; 82 } 83 84 public boolean equals(Object o) 85 { 86 return (o instanceof Map ) && ((Map )o).size() == 0; 87 } 88 89 public int hashCode() 90 { 91 return 0; 92 } 93 } 94 | Popular Tags |