Klasse SwitchStatement

Alle implementierten Schnittstellen:
TypeConstants, TypeIds
Bekannte direkte Unterklassen:
SwitchExpression

public class SwitchStatement extends Expression
  • Felddetails

  • Konstruktordetails

    • SwitchStatement

      public SwitchStatement()
  • Methodendetails

    • getFallThroughState

      protected int getFallThroughState(Statement stmt, BlockScope blockScope)
    • completeNormallyCheck

      protected void completeNormallyCheck(BlockScope blockScope)
    • needToCheckFlowInAbsenceOfDefaultBranch

      protected boolean needToCheckFlowInAbsenceOfDefaultBranch()
    • analyseCode

      public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo)
      Setzt außer Kraft:
      analyseCode in Klasse Expression
    • generateCodeForStringSwitch

      public void generateCodeForStringSwitch(BlockScope currentScope, CodeStream codeStream)
      Switch on String code generation This assumes that hashCode() specification for java.lang.String is API and is stable.
      Parameter:
      currentScope - org.eclipse.jdt.internal.compiler.lookup.BlockScope
      codeStream - org.eclipse.jdt.internal.compiler.codegen.CodeStream
      Siehe auch:
      • "http://download.oracle.com/javase/6/docs/api/java/lang/String.html"
    • generateCode

      public void generateCode(BlockScope currentScope, CodeStream codeStream)
      Switch code generation
      Setzt außer Kraft:
      generateCode in Klasse Expression
      Parameter:
      currentScope - org.eclipse.jdt.internal.compiler.lookup.BlockScope
      codeStream - org.eclipse.jdt.internal.compiler.codegen.CodeStream
    • statementGenerateCode

      protected void statementGenerateCode(BlockScope currentScope, CodeStream codeStream, Statement statement)
    • generateCode

      public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired)
      Beschreibung aus Klasse kopiert: Expression
      Every expression is responsible for generating its implicit conversion when necessary.
      Setzt außer Kraft:
      generateCode in Klasse Expression
      Parameter:
      currentScope - org.eclipse.jdt.internal.compiler.lookup.BlockScope
      codeStream - org.eclipse.jdt.internal.compiler.codegen.CodeStream
      valueRequired - boolean
    • printStatement

      public StringBuffer printStatement(int indent, StringBuffer output)
      Setzt außer Kraft:
      printStatement in Klasse Expression
    • addSecretTryResultVariable

      protected void addSecretTryResultVariable()
    • collectPatternVariablesToScope

      public void collectPatternVariablesToScope(LocalVariableBinding[] variables, BlockScope skope)
      Setzt außer Kraft:
      collectPatternVariablesToScope in Klasse Expression
    • resolve

      public void resolve(BlockScope upperScope)
      Setzt außer Kraft:
      resolve in Klasse Expression
    • isEnhanced

      public boolean isEnhanced()
    • reportMissingEnumConstantCase

      protected void reportMissingEnumConstantCase(BlockScope upperScope, FieldBinding enumConstant)
    • ignoreMissingDefaultCase

      protected boolean ignoreMissingDefaultCase(CompilerOptions compilerOptions, boolean isEnumSwitch)
    • isTrulyExpression

      public boolean isTrulyExpression()
      Setzt außer Kraft:
      isTrulyExpression in Klasse Expression
    • traverse

      public void traverse(ASTVisitor visitor, BlockScope blockScope)
      Beschreibung aus Klasse kopiert: Expression
      Traverse an expression in the context of a blockScope
      Setzt außer Kraft:
      traverse in Klasse Expression
      Parameter:
      visitor -
      blockScope -
    • branchChainTo

      public void branchChainTo(BranchLabel label)
      Dispatch the call on its last statement.
      Setzt außer Kraft:
      branchChainTo in Klasse Statement
    • doesNotCompleteNormally

      public boolean doesNotCompleteNormally()
      Beschreibung aus Klasse kopiert: Statement
      Lambda shape analysis: *Assuming* this is reachable, analyze if this completes normally i.e control flow can reach the textually next statement. For blocks, we don't perform intra-reachability analysis. We assume the lambda body is free of intrinsic control flow errors (if such errors exist they will not be flagged by this analysis, but are guaranteed to surface later on.)
      Setzt außer Kraft:
      doesNotCompleteNormally in Klasse Statement
      Siehe auch:
    • completesByContinue

      public boolean completesByContinue()
      Beschreibung aus Klasse kopiert: Statement
      Lambda shape analysis: *Assuming* this is reachable, analyze if this completes by continuing i.e control flow cannot reach the textually next statement. This is necessitated by the fact that continue claims to not complete normally. So this is necessary to discriminate between do { continue; } while (false); which completes normally and do { throw new Exception(); } while (false); which does not complete normally.
      Setzt außer Kraft:
      completesByContinue in Klasse Statement
    • canCompleteNormally

      public boolean canCompleteNormally()
      Beschreibung aus Klasse kopiert: Statement
      Switch Expression analysis: *Assuming* this is reachable, analyze if this completes normally i.e control flow can reach the textually next statement, as per JLS 14 Sec 14.22 For blocks, we don't perform intra-reachability analysis. Note: delinking this from a similar (opposite) Statement.doesNotCompleteNormally() since that was coded for a specific purpose of Lambda Shape Analysis.
      Setzt außer Kraft:
      canCompleteNormally in Klasse Statement
    • continueCompletes

      public boolean continueCompletes()
      Beschreibung aus Klasse kopiert: Statement
      The equivalent function of completesByContinue - implements both the rules concerning continue with and without a label.
      Setzt außer Kraft:
      continueCompletes in Klasse Statement
    • printExpression

      public StringBuffer printExpression(int indent, StringBuffer output)
      Angegeben von:
      printExpression in Klasse Expression