|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.problets.domain.model.DomainModel
org.problets.domain.model.control.ControlModel
org.problets.domain.model.control.ConditionControl
org.problets.domain.model.control.iteration.AbstractLoopModel
org.problets.domain.model.control.iteration.ForLoopModel
public class ForLoopModel
Class: ForLoopModel Purpose: Class for for loops
Field Summary | |
---|---|
static int |
IDENTITY
|
Fields inherited from class org.problets.domain.model.control.iteration.AbstractLoopModel |
---|
ASSIGNMENT_IN_CONDITION, CONST_CONDITION, DECLARATION_IN_CONDITION, INCORRECT_UPDATE, NO_UPDATE, NULL_CONDITION, TERMINAL_MODIFIED |
Fields inherited from class org.problets.domain.model.control.ConditionControl |
---|
INCORRECT_TYPE |
Fields inherited from class org.problets.domain.model.control.ControlModel |
---|
ABORT_EXECUTION, BREAK_EXECUTION, CONTINUE_EXECUTION, END_EXECUTION, INFINITE_EXECUTION, RETURN_EXECUTION, RUN_TIME_ERROR_EXECUTION, SKIP_EXECUTION |
Constructor Summary | |
---|---|
ForLoopModel(ActivationRecord parent,
HeapModel heap,
java.lang.String in_template,
int in_scopeType)
public ForLoopModel(ActivationRecord parent, HeapModel heap, String in_template, int in_scopeType); The constructor for the ForLoopModel class |
Method Summary | |
---|---|
ExecutionStatus |
explainInitial(RunEnv runEnv,
Behavior behavior,
boolean stepFlag,
int lineNumber)
public void explainInitial(Vector explanation, Vector errors, int lineNumber); This function handles explaining any declarations, initializations, or assignments in the for loop header |
ExecutionStatus |
explainProcess(RunEnv runEnv,
Behavior behavior,
boolean stepFlag)
public void explainProcess(Vector explanation, OutputStream output, Vector errors) This function generates the explanation of the code for the student. |
ExecutionStatus |
explainUpdate(RunEnv runEnv,
Behavior behavior,
int lineNumber)
public void explainUpdate(Vector explanation, Vector errors, int lineNumber); This function handles explaining any update that occurs in the for loop header |
void |
getCode(java.util.Vector codeText,
OutputStream output)
public void getCode(Vector codeText, OutputStream output) This function generates the code seen by the student |
java.lang.String |
getName()
Get the name of this control construct - for generation of error menus |
static boolean |
grade(java.lang.String template,
java.lang.String code)
|
static void |
main(java.lang.String[] args)
|
void |
parseHeader(java.lang.String header)
protected void parseHeader(String header); Extract the initial, condition, and update parts of the For Loop Header |
Methods inherited from class org.problets.domain.model.control.iteration.AbstractLoopModel |
---|
getLoopValues, getPossibleErrors |
Methods inherited from class org.problets.domain.model.control.ControlModel |
---|
getCodeLength, getStartLineNumber |
Methods inherited from class org.problets.domain.model.DomainModel |
---|
clone, getId, getIdName |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int IDENTITY
Constructor Detail |
---|
public ForLoopModel(ActivationRecord parent, HeapModel heap, java.lang.String in_template, int in_scopeType)
parent
- - an Activation record passed from the parentheap
- - the heap object usedin_template
- - holds the for loop templatein_scopeType
- - the scope type for this scope objectMethod Detail |
---|
public void parseHeader(java.lang.String header)
header
- - a String that holds the headerpublic java.lang.String getName()
getName
in class ControlModel
public void getCode(java.util.Vector codeText, OutputStream output)
getCode
in class ControlModel
codeText
- - a vector that holds the codepublic ExecutionStatus explainInitial(RunEnv runEnv, Behavior behavior, boolean stepFlag, int lineNumber)
explanation
- - a vector holding the explanationerrors
- - a vector holding any errorslineNumber
- - holds the current line numberpublic ExecutionStatus explainUpdate(RunEnv runEnv, Behavior behavior, int lineNumber)
explanation
- - a vector holding the explanationerrors
- - a vector holding any errorslineNumber
- - holds the current line numberpublic ExecutionStatus explainProcess(RunEnv runEnv, Behavior behavior, boolean stepFlag)
explainProcess
in class ControlModel
explanation
- - a vector holding the explanation lineserrors
- - a vector holding the error lines
public static boolean grade(java.lang.String template, java.lang.String code)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |