1 8 14 package jfun.yan; 15 16 import java.util.Collection ; 17 import java.util.List ; 18 import java.util.Set ; 19 20 30 public class DelegatingComponentMap implements ComponentMap { 31 private final ComponentMap cmap; 32 33 34 public boolean containsKey(Object key) { 35 return cmap.containsKey(key); 36 } 37 public boolean containsType(Class type) { 38 return cmap.containsType(type); 39 } 40 44 public DelegatingComponentMap(final ComponentMap cmap) { 45 this.cmap = cmap; 46 } 47 public Dependency getDependencyOfType(Class type, ComponentMap cmap) { 48 return cmap.getDependencyOfType(type, cmap); 49 } 50 public Dependency getDependency(Object key, ComponentMap cmap) { 51 return cmap.getDependency(key, cmap); 52 } 53 public Component getComponent(Object key) { 54 return cmap.getComponent(key); 55 } 56 public boolean equals(Object other) { 57 if(other instanceof DelegatingComponentMap){ 58 DelegatingComponentMap map2 = (DelegatingComponentMap)other; 59 return cmap.equals(map2.cmap); 60 } 61 else return cmap.equals(other); 62 } 63 public int hashCode() { 64 return cmap.hashCode(); 65 } 66 public String toString() { 67 return cmap.toString(); 68 } 69 73 protected final ComponentMap getDelegateTarget(){ 74 return cmap; 75 } 76 77 public Component getComponentOfType(Class type) { 78 return cmap.getComponentOfType(type); 79 } 80 public List getComponentsOfType(Class type) { 81 return cmap.getComponentsOfType(type); 82 } 83 public Collection getComponents() { 84 return cmap.getComponents(); 85 } 86 public Set keys() { 87 return cmap.keys(); 88 } 89 } 90 | Popular Tags |