1 8 14 package jfun.yan; 15 16 import jfun.yan.function.Signature; 17 18 31 public class ManualDependency implements Dependency { 32 private final ComponentMap cmap; 33 private final Object ckey; 34 35 40 public ManualDependency(final ComponentMap cmap, final Object ckey) { 41 this.cmap = cmap; 42 this.ckey = ckey; 43 } 44 45 public Object getArgument(final Signature src, int i, Class type){ 46 throw new IrresolveableArgumentException(ckey, i, type); 47 } 48 public Object getProperty(Class component_type, Object local_key, Class type){ 49 throw new IrresolveablePropertyException(ckey, local_key, type); 50 } 51 public Class verifyArgument(final Signature src, int i, Class type){ 52 throw new IrresolveableArgumentException(ckey, i, type); 53 } 54 public Class verifyProperty(Class component_type, Object local_key, Class type){ 55 throw new IrresolveablePropertyException(ckey, local_key, type); 56 } 57 58 public ComponentMap getComponentMap() { 59 return cmap; 60 } 61 public Object getComponentKey() { 62 return ckey; 63 } 64 65 public boolean equals(Object obj) { 66 if(obj instanceof ManualDependency){ 67 final ManualDependency mpp2 = (ManualDependency)obj; 68 return ckey.equals(mpp2.ckey); 69 } 70 else return false; 71 } 72 public int hashCode() { 73 return ckey.hashCode(); 74 } 75 public String toString() { 76 return ckey.toString(); 77 } 78 public Dependency getParent(){ 79 return null; 80 } 81 public Dependency getOriginal(){ 82 return this; 83 } 84 public Dependency seal(){ 85 return this; 86 } 87 } 88 | Popular Tags |