uk.co.badgersinfoil.metaas
Interface ASSwitchStatement


public interface ASSwitchStatement

Obtained from StatementContainer.newSwitch(String), an ASSwitchStatement allows 'case' and 'default' statements to be added to to the 'switch' statement. e.g.

 ASSwitchStatement switchStmt = method.newSwitch("c");
 switchStmt.newCase("'a'").addStmt("aay()");
 switchStmt.newCase("'b'").addStmt("bee()");
 switchStmt.newDefault().addStmt("cee()");
 
Will result in ActionScript something like,
 switch(c) {
        case 'a':
                aay();
        case 'b':
                bee();
        default:
                cee();
 }
 
Note that to add 'break' statements, you can use switchStmt.addStmt("break").


Method Summary
 StatementContainer newCase(java.lang.String string)
          Returns the statements to be executed in the given case for this switch statement.
 StatementContainer newDefault()
          Returns the statements to be executed in the default case for this switch statement.
 

Method Detail

newCase

StatementContainer newCase(java.lang.String string)
Returns the statements to be executed in the given case for this switch statement. Do not call this method more than once with the same value, as this may result in incorrect code.


newDefault

StatementContainer newDefault()
Returns the statements to be executed in the default case for this switch statement. Do not call this method more than once, as this may result in incorrect code.



Copyright © 2006 null. All Rights Reserved.