Interface CtSwitch<S>

Type Parameters:
S - the type of the selector expression (it would be better to be able to define an upper bound, but it is not possible because of Java's type hierarchy, especially since the enums that make things even worse!)
All Superinterfaces:
Cloneable, CtAbstractSwitch<S>, CtCodeElement, CtElement, CtQueryable, CtStatement, CtVisitable, FactoryAccessor, Serializable, SourcePositionHolder
All Known Implementing Classes:
CtSwitchImpl

public interface CtSwitch<S> extends CtStatement, CtAbstractSwitch<S>
This code element defines a switch statement. Example:
 int x = 0;
 switch(x) { // <-- switch statement
     case 1:
       System.out.println("foo");
 }
  • Method Details

    • clone

      CtSwitch<S> clone()
      Description copied from interface: CtElement
      Clone the element which calls this method in a new object. Note that that references are kept as is, and thus, so if you clone whole classes or methods, some parts of the cloned element (eg executable references) may still point to the initial element. In this case, consider using methods Refactoring.copyType(CtType) and Refactoring.copyMethod(CtMethod) instead which does additional work beyond cloning.
      Specified by:
      clone in interface CtCodeElement
      Specified by:
      clone in interface CtElement
      Specified by:
      clone in interface CtStatement
      Returns:
      a clone of this element. All children are cloned, but the parent of the returned clone is set to null.