KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > yan > ReturnVerificationComponent


1 /*****************************************************************************
2  * Copyright (C) Codehaus.org. All rights reserved. *
3  * ------------------------------------------------------------------------- *
4  * The software in this package is published under the terms of the BSD *
5  * style license a copy of which has been included with this distribution in *
6  * the LICENSE.txt file. *
7  *****************************************************************************/

8 /*
9  * Created on Mar 22, 2005
10  *
11  * Author Ben Yu
12  * ZBS
13  */

14 package jfun.yan;
15
16 /**
17  * Codehaus.org.
18  *
19  * @author Ben Yu
20  *
21  */

22 final class ReturnVerificationComponent extends Component {
23   private final Verifiable veri;
24   
25   public Class JavaDoc getType() {
26     return Class JavaDoc.class;
27   }
28   public boolean isConcrete(){
29     return true;
30   }
31   public Object JavaDoc create(Dependency pp){
32     return veri.verify(pp);
33   }
34   public Class JavaDoc verify(Dependency pp){
35     return veri.verify(pp);
36   }
37   
38   public boolean equals(Object JavaDoc obj) {
39     if(obj instanceof ReturnVerificationComponent){
40       final ReturnVerificationComponent rv2 = (ReturnVerificationComponent)obj;
41       return veri.equals(rv2.veri);
42     }
43     else return false;
44   }
45   public int hashCode() {
46     return veri.hashCode();
47   }
48   public String JavaDoc toString() {
49     return "returnVerification <" + veri +">";
50   }
51   ReturnVerificationComponent(final Verifiable veri) {
52     this.veri = veri;
53   }
54   public boolean isSingleton(){
55     return false;
56   }
57   
58 }
59
Popular Tags