|
||||||||||
| 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.selection.Selection
org.problets.domain.model.control.selection.CaseModel
public class CaseModel
Class: CaseModel Purpose: For every case, parses statements, blocks, and nested switch statements and adds it to statement sequence or block
| Field Summary |
|---|
| 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 | |
|---|---|
CaseModel(ActivationRecord parent,
HeapModel heap,
java.lang.String in_template,
java.util.Vector statements)
Constructor |
|
| Method Summary | |
|---|---|
ExecutionStatus |
explainProcess(RunEnv runEnv,
Behavior behavior,
boolean stepFlag)
public int explainProcess( RunEnv runEnv, Behavior behavior, boolean stepFlag) Single case is checked and explained if it is correct |
void |
getCode(java.util.Vector codeText,
OutputStream output)
public void getCode(Vector codeText, OutputStream output, Object caseModel) Display single case on the screen at a time |
java.lang.String |
getHeader()
Gets the Header for the case |
java.lang.String |
getProcessedExpression()
Processed version of caseValueExpression |
static boolean |
grade(java.lang.String template,
java.lang.String studentCode)
Grade is used for checking student's code compared to the actual code. |
static boolean |
gradeOld(java.lang.String template,
java.lang.String studentCode)
Grade is used for checking student's code compared to the actual code. |
boolean |
matches(StackModel stack,
Value conditionValue)
public boolean matches( Value conditionValue ) Matches the value of switch condition and the case value |
| Methods inherited from class org.problets.domain.model.control.selection.Selection |
|---|
main |
| Methods inherited from class org.problets.domain.model.control.ConditionControl |
|---|
getPossibleErrors |
| Methods inherited from class org.problets.domain.model.control.ControlModel |
|---|
getCodeLength, getName, 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 |
| Constructor Detail |
|---|
public CaseModel(ActivationRecord parent,
HeapModel heap,
java.lang.String in_template,
java.util.Vector statements)
parent - - the nested scope's parent activation recordheap - - the heap to be usedin_template - - the template to be parsedstatements - - contains the cases and its statements| Method Detail |
|---|
public java.lang.String getProcessedExpression()
public boolean matches(StackModel stack,
Value conditionValue)
conditionValue - - Integer value of the switch condition
public java.lang.String getHeader()
public void getCode(java.util.Vector codeText,
OutputStream output)
getCode in class ControlModelcodeText - - a Vector that holds the codeoutput - - For outputting the code on the screencaseModel - - Hold the current case which is executed
public ExecutionStatus explainProcess(RunEnv runEnv,
Behavior behavior,
boolean stepFlag)
explainProcess in class ControlModelrunEnv - - Run Environment of the programbehavior - - behavior of the programstepFlag - - execution flag
public static boolean grade(java.lang.String template,
java.lang.String studentCode)
public static boolean gradeOld(java.lang.String template,
java.lang.String studentCode)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||