1 8 14 package jfun.yan; 15 16 22 final class ReturnStateComponent extends Component { 23 private final Stateful cc; 24 public boolean isConcrete(){ 25 return false; 26 } 27 ReturnStateComponent(final Stateful cc) { 28 this.cc = cc; 29 } 30 public Class verify(Dependency pp){ 31 return Object .class; 32 } 33 public Object create(Dependency pp){ 34 return cc.getState(); 35 } 36 public Class getType(){ 37 return Object .class; 38 } 39 public String toString(){ 40 return "returnState <" + cc +">"; 41 } 42 43 public boolean equals(Object obj) { 44 if(obj instanceof ReturnStateComponent){ 45 final ReturnStateComponent rsc2 = (ReturnStateComponent)obj; 46 return cc.equals(rsc2.cc); 47 } 48 else return false; 49 } 50 public int hashCode() { 51 return cc.hashCode()+1; 52 } 53 public boolean isSingleton(){ 54 return false; 55 } 56 } 57 | Popular Tags |