Extension SDK 10.1.2

oracle.jdeveloper.jot
Interface JotFor

All Superinterfaces:
JotBlockElement, JotCodeElement, JotConditional, JotElement, JotHasChildStatement, JotStatement

public interface JotFor
extends JotConditional

A JotFor represents a for statement. A for statement contains three expressions, any or all of which can be null, and a child statement.

Since:
5.0
See Also:
"Section 14.13 of the Java Language Specification"

Field Summary
 
Fields inherited from interface oracle.jdeveloper.jot.JotStatement
BLOCK_STATEMENT, BREAK_STATEMENT, CASE_CLAUSE, CONTINUE_STATEMENT, DO_STATEMENT, ELSE_CLAUSE, EMPTY_STATEMENT, EXPRESSION_STATEMENT, FOR_STATEMENT, IF_STATEMENT, RETURN_STATEMENT, SWITCH_STATEMENT, SYNCHRONIZED_STATEMENT, THROW_STATEMENT, TRY_STATEMENT, WHILE_STATEMENT
 
Fields inherited from interface oracle.jdeveloper.jot.JotBlockElement
LOCAL_CLASS_TYPE, STATEMENT_TYPE, VARIABLE_DECLARATION_TYPE
 
Method Summary
 JotStatementExpression addForUpdateExpression(JotStatementExpression marker, boolean before, java.lang.String exp)
          Adds a new expression to the update clause of this for statement.
 JotExpression getConditionalExpression()
          Retrieves the conditional expression of the for statement.
 java.lang.String getForInitialization()
          Retrieves the intialization code of the for statement.
 JotForInitializer getForInitializer()
          Retrieves the JotForInitializer that represents the initialization clause of this for statement
 JotStatementExpression[] getForUpdate()
          Retrieves the expression comprising the update clause of this statement.
 void removeForUpdateExpression(JotStatementExpression exp)
          Removes an existing expression from the update clause.
 void setConditionalExpression(java.lang.String exp)
          Sets the conditional expression of this for statement.
 void setForInitialization(java.lang.String newInit)
          Sets the intialization code the for statement.
 
Methods inherited from interface oracle.jdeveloper.jot.JotHasChildStatement
addBlock, addBreak, addContinue, addDo, addExpressionStatement, addExpressionStatement, addFor, addIf, addReturn, addStatement, addSwitch, addSynchronized, addThrow, addTry, addWhile, createAssignment, createMethodCall, createNestedMethodCall, getChildStatement
 
Methods inherited from interface oracle.jdeveloper.jot.JotStatement
addLabel, getAsBlock, getAsBreak, getAsCase, getAsContinue, getAsDo, getAsExpressionStatement, getAsFor, getAsIf, getAsReturn, getAsSwitch, getAsSynchronized, getAsThrow, getAsTry, getAsWhile, getLabels, getStatementText, getStatementType, removeLabel
 
Methods inherited from interface oracle.jdeveloper.jot.JotBlockElement
getAsLocalClass, getAsStatement, getAsVariableDeclaration, getElementType
 
Methods inherited from interface oracle.jdeveloper.jot.JotCodeElement
addPrecedingComment, childrenContainErrors, delete, getContainingJotFile, getLeftWhitespace, getLength, getRightWhitespace, isInError, isSource, setLeftWhitespace, setRightWhitespace
 
Methods inherited from interface oracle.jdeveloper.jot.JotElement
getChildren, getContainedElements, getElementName, getEndOffset, getID, getJotWorkArea, getParent, getStartOffset, isExistent, isReadOnly, isStructureKnown, setParent
 

Method Detail

getForInitialization

public java.lang.String getForInitialization()
                                      throws JotInvalidElementException
Retrieves the intialization code of the for statement.

Returns:
a String encapsulating the initialization code.
Throws:
JotInvalidElementException

getForInitializer

public JotForInitializer getForInitializer()
                                    throws JotInvalidElementException
Retrieves the JotForInitializer that represents the initialization clause of this for statement

Throws:
JotInvalidElementException

setForInitialization

public void setForInitialization(java.lang.String newInit)
                          throws JotInvalidElementException
Sets the intialization code the for statement.

Parameters:
newInit - the new initialization code
Throws:
JotInvalidElementException

getConditionalExpression

public JotExpression getConditionalExpression()
                                       throws JotInvalidElementException
Retrieves the conditional expression of the for statement. This expression will be null if the for statement does not include a condition.

Specified by:
getConditionalExpression in interface JotConditional
Returns:
the conditional expression
Throws:
JotInvalidElementException

setConditionalExpression

public void setConditionalExpression(java.lang.String exp)
                              throws JotInvalidElementException
Sets the conditional expression of this for statement. Setting the expression to null will remove the expression,

Specified by:
setConditionalExpression in interface JotConditional
Parameters:
exp - the new conditional expression.
Throws:
JotInvalidElementException

getForUpdate

public JotStatementExpression[] getForUpdate()
                                      throws JotInvalidElementException
Retrieves the expression comprising the update clause of this statement. If the update clause is blank, a zero-length array is returned.

Returns:
an array of JotStatementExpressions objects representing the update clause expressions.
Throws:
JotInvalidElementException

addForUpdateExpression

public JotStatementExpression addForUpdateExpression(JotStatementExpression marker,
                                                     boolean before,
                                                     java.lang.String exp)
                                              throws JotInvalidElementException
Adds a new expression to the update clause of this for statement.

Parameters:
marker - an existing expression to position relative to, or null if the expression should be positioned at the beginning or end of the update clause.
before - whether to position the new expression before or after the existing marker expression; or if marker is null, whether to position the new expression at the beginning or the end of the update clause
exp - the new expression to add.
Returns:
the newly created expression
Throws:
JotInvalidElementException

removeForUpdateExpression

public void removeForUpdateExpression(JotStatementExpression exp)
                               throws JotInvalidElementException
Removes an existing expression from the update clause.

Parameters:
exp - the expression to remove
Throws:
JotInvalidElementException

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.