1 package polyglot.ast; 2 3 import java.util.List; 4 5 /** 6 * An immutable representation of a <code>try</code> block, one or more 7 * <code>catch</code> blocks, and an optional <code>finally</code> block. 8 * 9 */ 10 public interface Try extends CompoundStmt 11 { 12 /** The block to "try". */ 13 Block tryBlock(); 14 15 /** Set the block to "try". */ 16 Try tryBlock(Block tryBlock); 17 18 /** List of catch blocks. 19 * @return A list of {@link polyglot.ast.Catch Catch}. 20 */ 21 List catchBlocks(); 22 23 /** Set the list of catch blocks. 24 * @param catchBlocks A list of {@link polyglot.ast.Catch Catch}. 25 */ 26 Try catchBlocks(List catchBlocks); 27 28 /** The block to "finally" execute. */ 29 Block finallyBlock(); 30 31 /** Set the block to "finally" execute. */ 32 Try finallyBlock(Block finallyBlock); 33 } 34