01: /*
02: * Spoon - http://spoon.gforge.inria.fr/
03: * Copyright (C) 2006 INRIA Futurs <renaud.pawlak@inria.fr>
04: *
05: * This software is governed by the CeCILL-C License under French law and
06: * abiding by the rules of distribution of free software. You can use, modify
07: * and/or redistribute the software under the terms of the CeCILL-C license as
08: * circulated by CEA, CNRS and INRIA at http://www.cecill.info.
09: *
10: * This program is distributed in the hope that it will be useful, but WITHOUT
11: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12: * FITNESS FOR A PARTICULAR PURPOSE. See the CeCILL-C License for more details.
13: *
14: * The fact that you are presently reading this means that you have had
15: * knowledge of the CeCILL-C license and that you accept its terms.
16: */
17:
18: package spoon.reflect.code;
19:
20: import java.util.List;
21:
22: /**
23: * This code element defines a <code>switch</code> statement.
24: *
25: * @param <S>
26: * the type of the selector expression (it would be better to be able
27: * to define an upper bound, but it is not possible because of Java's
28: * type hierachy, especially since the enums that make things even
29: * worse!)
30: */
31: public interface CtSwitch<S> extends CtStatement {
32: /**
33: * Gets the selector. The type of the Expression must be <code>char</code>,
34: * <code>byte</code>, <code>short</code>, <code>int</code>,
35: * <code>Character</code>, <code>Byte</code>, <code>Short</code>,
36: * <code>Integer</code>, or an <code>enum</code> type
37: */
38: CtExpression<S> getSelector();
39:
40: /**
41: * Sets the selector. The type of the Expression must be <code>char</code>,
42: * <code>byte</code>, <code>short</code>, <code>int</code>,
43: * <code>Character</code>, <code>Byte</code>, <code>Short</code>,
44: * <code>Integer</code>, or an <code>enum</code> type
45: */
46: void setSelector(CtExpression<S> selector);
47:
48: /**
49: * Gets the list of cases defined for this switch.
50: */
51: List<CtCase<? super S>> getCases();
52:
53: /**
54: * Sets the list of cases defined for this switch.
55: */
56: void setCases(List<CtCase<? super S>> cases);
57: }
|