KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > spoon > reflect > code > CtSwitch


1 package spoon.reflect.code;
2
3 import java.util.List JavaDoc;
4
5 /**
6  * This code element defines a <code>switch</code> statement.
7  *
8  * @param <S> the type of the selector expression (it would be better to be able
9  * to define an upper bound, but it is not possible because of Java's
10  * type hierachy, especially since the enums that make things even
11  * worse!)
12  */

13 public interface CtSwitch<S> extends CtStatement {
14     /**
15      * Gets the selector. The type of the Expression must be <code>char</code>,
16      * <code>byte</code>, <code>short</code>, <code>int</code>,
17      * <code>Character</code>, <code>Byte</code>, <code>Short</code>,
18      * <code>Integer</code>, or an <code>enum</code> type
19      */

20     CtExpression<S> getSelector();
21
22     /**
23      * Sets the selector. The type of the Expression must be <code>char</code>,
24      * <code>byte</code>, <code>short</code>, <code>int</code>,
25      * <code>Character</code>, <code>Byte</code>, <code>Short</code>,
26      * <code>Integer</code>, or an <code>enum</code> type
27      */

28     void setSelector(CtExpression<S> selector);
29
30     /**
31      * Gets the list of cases defined for this switch.
32      */

33     List JavaDoc<CtCase<? super S>> getCases();
34
35     /**
36      * Sets the list of cases defined for this switch.
37      */

38     void setCases(List JavaDoc<CtCase<? super S>> cases);
39 }
40
Popular Tags