org.problets.domain.model.variable
Class RefVarModel

java.lang.Object
  extended by org.problets.domain.model.DomainModel
      extended by org.problets.domain.model.variable.AbstractVarModel
          extended by org.problets.domain.model.variable.AccessVarModel
              extended by org.problets.domain.model.variable.RefVarModel
All Implemented Interfaces:
java.lang.Cloneable

public class RefVarModel
extends AccessVarModel

Reference variable

Author:
Amruth Kumar

Field Summary
static int IDENTITY
           
static java.lang.String INVALID_INITIALIZATION
           
static java.lang.String NO_INITIALIZATION
           
static java.lang.String NOT_DECLARED
           
static java.lang.String OUT_OF_SCOPE
           
 
Fields inherited from class org.problets.domain.model.DomainModel
BOOLEAN, BREAKPOINT, CHARACTER, DOUBLE_PRECISION_REAL, ERROR_TYPE, EVAL_STATUS, expACTION, expASSIGNMENT, expAUTO_DEALLOCATION, expCALL, expCONDITION, expDECLARATION, expDEREFERENCING, expDYNAMIC_ALLOCATION, expDYNAMIC_ALLOCATION_INITIALIZATION, expDYNAMIC_DEALLOCATION, expELSE_CLAUSE, expERROR, expEXECUTION, expIF_CLAUSE, expINITIALIZATION, expINPUT, expPARAMETER_PASSING, expPRINT, expQUESTIONABLE, expREFERENCING, expRETURN, expRUNTIME_ERROR, expSEMANTIC_ERROR, expSYNTAX_ERROR, expUPDATE, MAX_OBJECT_IDENTITY, MIN_OBJECT_IDENTITY, QUADRUPLE_PRECISION_REAL, RUNTIME_ERROR, SEMANTIC_ERROR, SIGNED_INTEGER, SIGNED_LONG, SIGNED_SHORT, SINGLE_PRECISION_REAL, SYNTAX_ERROR, UNDEFINED_TYPE, UNSIGNED_INTEGER, UNSIGNED_LONG, UNSIGNED_SHORT, WARNING
 
Constructor Summary
RefVarModel(int index, java.lang.String inputType)
           
 
Method Summary
 void addToAssignees(java.lang.String template, ActivationRecord activationRecord)
          Creates any random objects on RHS of initialization or assignment and adds variables on RHS to the list of objects to which the access variable points - so that these objects can be displayed in the drop-down menu for the access variable
 java.lang.Object clone()
          Returns a clone of this object, and provides the basis for cloning of derived classes
 void explainObject(StackModel stack, HeapModel heap, Behavior behavior, java.lang.String statement, int event, int lineNumber, boolean abbreviated)
          -----------------------------------------------------
 void explainProcess(RunEnv runEnv, Behavior behavior, java.lang.String statement, int event, int lineNumber)
           
 void getCode(java.util.Vector codeText, java.lang.String codeType, java.lang.String template, int lineNumber)
           
 AbstractVarModel getLValue()
          Returns a reference to the object to which the pointer points
 java.lang.String[] getPossibleErrors()
          Method to return errors for variables May want to post-process based on Student Model
 Value getValue()
           
static void main(java.lang.String[] args)
           
 void print()
           
 void setDeclared()
           
 void setValue(java.lang.Object inValue)
          Used by Assignment Expression
 
Methods inherited from class org.problets.domain.model.variable.AccessVarModel
getAssignees
 
Methods inherited from class org.problets.domain.model.variable.AbstractVarModel
getAllocated, getAssigned, getDeclared, getMetaDataType, getName, getType, getValueDifference, resetAllocated, resetDeclared, resetFlags, setAllocated
 
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
 

Field Detail

IDENTITY

public static final int IDENTITY
See Also:
Constant Field Values

NOT_DECLARED

public static final java.lang.String NOT_DECLARED
See Also:
Constant Field Values

OUT_OF_SCOPE

public static final java.lang.String OUT_OF_SCOPE
See Also:
Constant Field Values

NO_INITIALIZATION

public static final java.lang.String NO_INITIALIZATION
See Also:
Constant Field Values

INVALID_INITIALIZATION

public static final java.lang.String INVALID_INITIALIZATION
See Also:
Constant Field Values
Constructor Detail

RefVarModel

public RefVarModel(int index,
                   java.lang.String inputType)
Method Detail

clone

public java.lang.Object clone()
Description copied from class: DomainModel
Returns a clone of this object, and provides the basis for cloning of derived classes

Overrides:
clone in class AbstractVarModel

getValue

public Value getValue()
Overrides:
getValue in class AbstractVarModel

getLValue

public AbstractVarModel getLValue()
Returns a reference to the object to which the pointer points

Parameters:
-
Returns:

setDeclared

public void setDeclared()
Overrides:
setDeclared in class AbstractVarModel

setValue

public void setValue(java.lang.Object inValue)
Description copied from class: AbstractVarModel
Used by Assignment Expression

Overrides:
setValue in class AbstractVarModel

addToAssignees

public void addToAssignees(java.lang.String template,
                           ActivationRecord activationRecord)
Description copied from class: AccessVarModel
Creates any random objects on RHS of initialization or assignment and adds variables on RHS to the list of objects to which the access variable points - so that these objects can be displayed in the drop-down menu for the access variable

Overrides:
addToAssignees in class AccessVarModel

getCode

public void getCode(java.util.Vector codeText,
                    java.lang.String codeType,
                    java.lang.String template,
                    int lineNumber)
Specified by:
getCode in class AbstractVarModel

getPossibleErrors

public java.lang.String[] getPossibleErrors()
Method to return errors for variables May want to post-process based on Student Model

Specified by:
getPossibleErrors in class AbstractVarModel

explainProcess

public void explainProcess(RunEnv runEnv,
                           Behavior behavior,
                           java.lang.String statement,
                           int event,
                           int lineNumber)
Specified by:
explainProcess in class AbstractVarModel

explainObject

public void explainObject(StackModel stack,
                          HeapModel heap,
                          Behavior behavior,
                          java.lang.String statement,
                          int event,
                          int lineNumber,
                          boolean abbreviated)
-----------------------------------------------------

Specified by:
explainObject in class AbstractVarModel
Parameters:
-

print

public void print()
Specified by:
print in class AbstractVarModel

main

public static void main(java.lang.String[] args)