KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > yan > ReturnTypeComponent


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