|
||||||||||
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.variable.AbstractVarModel
org.problets.domain.model.variable.aggregate.ErrorVarModel
public class ErrorVarModel
Class: ErrorVarModel Purpose: This class acts as a place holder for non-existent variables. For example, when an out of bounds access to an array occurs, an object of this class will be returned.
Field Summary |
---|
Constructor Summary | |
---|---|
ErrorVarModel(java.lang.String inputName,
java.lang.String inputType)
Creates a new error variable |
Method Summary | |
---|---|
void |
explainObject(StackModel stack,
HeapModel heap,
Behavior behavior,
java.lang.String statement,
int event,
int lineNumber,
boolean abbreviated)
To generate error messages for arrays after execution. |
void |
explainProcess(RunEnv runEnv,
Behavior behavior,
java.lang.String statement,
int event,
int lineNumber)
Executes a statement and provides an explanation based on what type of statement was executed. |
void |
getCode(java.util.Vector codeText,
java.lang.String codeType,
java.lang.String template,
int lineNumber)
Generates code for the template before execution |
java.lang.String[] |
getPossibleErrors()
Returns the possible errors for this variable |
static void |
main(java.lang.String[] args)
For Debugging |
void |
print()
Prints the value of the error variable |
void |
setName(java.lang.String inName)
Assigns the name of the ErrorVarModel. |
Methods inherited from class org.problets.domain.model.variable.AbstractVarModel |
---|
clone, getAllocated, getAssigned, getDeclared, getMetaDataType, getName, getType, getValue, getValueDifference, resetAllocated, resetDeclared, resetFlags, setAllocated, setDeclared, setValue |
Methods inherited from class org.problets.domain.model.DomainModel |
---|
getId, getIdName, grade |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ErrorVarModel(java.lang.String inputName, java.lang.String inputType)
inputName
- the name of the error variableinputType
- the type of the variable this error variable modelsMethod Detail |
---|
public void setName(java.lang.String inName)
inName
- the new name for the ErrorVarModelpublic void getCode(java.util.Vector codeText, java.lang.String codeType, java.lang.String template, int lineNumber)
getCode
in class AbstractVarModel
codeText
- the actual codecodeType
- the type of codetemplate
- the template to create the code forlineNumber
- the line number of the statementpublic java.lang.String[] getPossibleErrors()
getPossibleErrors
in class AbstractVarModel
public void explainProcess(RunEnv runEnv, Behavior behavior, java.lang.String statement, int event, int lineNumber)
explainProcess
in class AbstractVarModel
runEnv
- The run time environmentbehavior
- The current behaviorstatement
- The statement to executeevent
- The event of execution (ex. initialization, assignment, referencing,...)lineNumber
- The line number of the statementpublic void explainObject(StackModel stack, HeapModel heap, Behavior behavior, java.lang.String statement, int event, int lineNumber, boolean abbreviated)
explainObject
in class AbstractVarModel
stack
- the runtime stackheap
- the runtime heapbehavior
- the current behaviorstatement
- the statementevent
- the execution eventlineNumber
- the line number of the statementabbreviated
- switch for abreviated explanationspublic void print()
print
in class AbstractVarModel
public static void main(java.lang.String[] args)
args
- args
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |