KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > spoon > support > reflect > declaration > CtEnumImpl


1 package spoon.support.reflect.declaration;
2
3 import java.util.Set JavaDoc;
4
5 import spoon.reflect.declaration.CtEnum;
6 import spoon.reflect.declaration.CtMethod;
7 import spoon.reflect.reference.CtTypeReference;
8 import spoon.reflect.visitor.CtVisitor;
9
10 public class CtEnumImpl<T extends Enum JavaDoc> extends CtTypeImpl<T> implements
11         CtEnum<T> {
12     private static final long serialVersionUID = 1L;
13
14     public void accept(CtVisitor visitor) {
15         visitor.visitCtEnum(this);
16     }
17
18     public Set JavaDoc<CtMethod<?>> getAllMethods() {
19         return getMethods();
20     }
21
22     public boolean isSubtypeOf(CtTypeReference<?> type) {
23         for (CtTypeReference<?> ref : getSuperInterfaces()) {
24             if (ref.isSubtypeOf(type))
25                 return true;
26         }
27         return false;
28     }
29
30 }
31
Popular Tags