Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: javax/ide/model/java/source/tree/ForStatementT.java


1   /*
2    * @(#)ForStatementT.java
3    */
4   
5   package javax.ide.model.java.source.tree;
6   
7   import java.util.List;
8   
9   /**
10   * A for statement. JLS3 14.14. <p/>
11   *
12   * @author Andy Yu
13   * */
14  public interface ForStatementT
15    extends CompoundStatementT
16  {
17    // ----------------------------------------------------------------------
18  
19    /**
20     * FOR_EXPRESSION: A standard for loop with no variable declarations.
21     * FOR_VARIABLE_D: A standard for loop with variable declarations.
22     * FOR_ENHANCED: An enhanced for loop.
23     */
24    public byte getForType();
25  
26    /**
27     * In a standard for loop with variable declarations, this is the
28     * local variable declaration itself.
29     *
30     * @return The local variable declaration. Null if none.
31     */
32    public LocalVariableDeclT getForVariableDeclaration();
33  
34    /**
35     * Attempts to set the variable declaration on this for statement.
36     */
37    public void setForVariableDeclaration(LocalVariableDeclT decl);
38  
39    /**
40     * In a standard for loop with variable declarations, these are the
41     * variables declared in the initialization declaration. If there is
42     * a variable declaration, then this is equivalent to calling
43     * getForVariableDeclaration().getVariables().
44     *
45     * @return The array of variable declarations. <p/>
46     *
47     * List of LocalVariableTs.
48     */
49    public List getForVariables();
50  
51    /**
52     * In a standard for loop with no variable declarations, this is the
53     * list wrapping the initialization terms. Unless you need the
54     * actual ListExpression, you should probably use
55     * getForInitializations().
56     *
57     * @return The ListExpression wrapping the initializations. Null if
58     * none.
59     */
60    public ListExpressionT getForInitializationList();
61  
62    /**
63     * In a standard for loop with no variable declarations, these are
64     * the initialization terms. If there are initialization terms, this
65     * is equivalent to calling getForInitializationList().getOperands().
66     *
67     * @return The array of initialization terms. <p/>
68     *
69     * List of ExpressionTs.
70     */
71    public List getForInitializations();
72  
73    /**
74     * In a standard for loop, this is the condition expression.
75     * Syntax is "for( initialization; conditional; update) stmt".
76     * @return The conditional term. Null if there is none.
77     */
78    public ExpressionT getForConditional();
79  
80    /**
81     * Attempts to set the conditional expression on this for statement.
82     */
83    public void setForConditional(ExpressionT e);
84  
85    /**
86     * In a standard for loop, this is the list wrapping the update
87     * terms.  Syntax is "for( initialization; conditional; update)
88     * stmt". Unless you need the actual ListExpression, you should
89     * probably use getForUpdates().
90     *
91     * @return The ListExpression wrapping the updates. Null if none.
92     */
93    public ListExpressionT getForUpdateList();
94  
95    /**
96     * In a standard for loop, these are the update terms.  Syntax is
97     * "for( initialization; conditional; update) stmt". If there are
98     * update terms, this is equivalent to calling
99     * getForUpdateList().getOperands().
100    *
101    * @return The array of update terms. <p/>
102    *
103    * List of ExpressionTs.
104    */
105   public List getForUpdates();
106 
107   /**
108    * In an enhanced for loop, this is the collection expression.
109    * Syntax is "for ( type name: collection ) stmt".
110    * @return The expression for the collection term.
111    */
112   public ExpressionT getForCollection();
113 
114   /**
115    * Attempts to set the collection expression on this for statement.
116    */
117   public void setForCollection(ExpressionT e);
118 
119 
120   // ----------------------------------------------------------------------
121 }