org.problets.domain.model
Class DomainModel

java.lang.Object
  extended by org.problets.domain.model.DomainModel
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
AbstractVarModel, CodeModel, ControlModel, Expression, InputStream, NodeModel, OutputStream, Value

public abstract class DomainModel
extends java.lang.Object
implements java.lang.Cloneable

Serves as the base class for all domain objects, and provides constants for types of errors, meta-data-types, and events used by all the domain objects

Author:
Amruth Kumar

Field Summary
static int BOOLEAN
          Integer constant to represent boolean language-neutral meta-data type
static java.lang.String BREAKPOINT
          String constant to represent the breakpoint that can be used to stop execution
static int CHARACTER
          Integer constant to represent character language-neutral meta-data type
static int DOUBLE_PRECISION_REAL
          Integer constant to represent double precision real language-neutral meta-data type
static int ERROR_TYPE
          Integer constant to represent error language-neutral meta-data type
static int EVAL_STATUS
          Integer constant to represent evaluation status language-neutral meta-data type (such as short-circuited or skipped)
static int expACTION
          Integer constant to represent the event - evaluation of the action of a loop
static int expASSIGNMENT
          Integer constant to represent the event - assignment of a variable
static int expAUTO_DEALLOCATION
          Integer constant to represent the event - deallocation of a variable
static int expCALL
          Integer constant to represent the event - evaluation of a function call
static int expCONDITION
          Integer constant to represent the event - evaluation of the condition of a selection statement
static int expDECLARATION
          Integer constant to represent the event - declaration of a variable
static int expDEREFERENCING
          Integer constant to represent the event - dereferencing of a pointer
static int expDYNAMIC_ALLOCATION
          Integer constant to represent the event - dynamic allocation of a pointer
static int expDYNAMIC_ALLOCATION_INITIALIZATION
          Integer constant to represent the event - dynamic allocation and initialization of a pointer
static int expDYNAMIC_DEALLOCATION
          Integer constant to represent the event - dynamic deallocation of a pointer
static int expELSE_CLAUSE
          Integer constant to represent the event - evaluation of the else-clause of a selection statement
static int expERROR
          Integer constant to represent the event - generic error
static int expEXECUTION
          Integer constant to represent the event - generic execution
static int expIF_CLAUSE
          Integer constant to represent the event - evaluation of the if-clause of a selection statement
static int expINITIALIZATION
          Integer constant to represent the event - initialization of a variable
static int expINPUT
          Integer constant to represent the event - evaluation of an input statement
static int expPARAMETER_PASSING
          Integer constant to represent the event - evaluation of passing parameters to a function
static int expPRINT
          Integer constant to represent the event - evaluation of a print statement
static int expQUESTIONABLE
          Integer constant to represent the event - questionable execution
static int expREFERENCING
          Integer constant to represent the event - referencing of a variable
static int expRETURN
          Integer constant to represent the event - evaluation of returning from a function
static int expRUNTIME_ERROR
          Integer constant to represent the event - run-time error
static int expSEMANTIC_ERROR
          Integer constant to represent the event - semantic error
static int expSYNTAX_ERROR
          Integer constant to represent the event - syntax error
static int expUPDATE
          Integer constant to represent the event - evaluation of the loop variable update in a loop
static int IDENTITY
          The numerical identity of this class
static int MAX_OBJECT_IDENTITY
          The maximum numerical identity of any domain model class
static int MIN_OBJECT_IDENTITY
          The minimum numerical identity of any domain model class
static int QUADRUPLE_PRECISION_REAL
          Integer constant to represent quadruple precision real language-neutral meta-data type
static java.lang.String RUNTIME_ERROR
          String constant representing run-time errors
static java.lang.String SEMANTIC_ERROR
          String constant representing semantic or logic errors
static int SIGNED_INTEGER
          Integer constant to represent signed integer language-neutral meta-data type
static int SIGNED_LONG
          Integer constant to represent signed long language-neutral meta-data type
static int SIGNED_SHORT
          Integer constant to represent signed short language-neutral meta-data type
static int SINGLE_PRECISION_REAL
          Integer constant to represent single precision real language-neutral meta-data type
static java.lang.String SYNTAX_ERROR
          String constant representing syntax or compiler errors
static int UNDEFINED_TYPE
          Integer constant to represent undefined data type
static int UNSIGNED_INTEGER
          Integer constant to represent unsigned integer language-neutral meta-data type
static int UNSIGNED_LONG
          Integer constant to represent unsigned long language-neutral meta-data type
static int UNSIGNED_SHORT
          Integer constant to represent unsigned short language-neutral meta-data type
static java.lang.String WARNING
          String constant representing a warning
 
Constructor Summary
DomainModel()
           
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this object, and provides the basis for cloning of derived classes
 int getId()
          Returns the numeric id of this class
 java.lang.String getIdName(int id)
          Returns a string corresponding to the event's numeric id
static boolean grade(java.lang.String template, java.lang.String studentCode)
          Method to grade student-written code generated by this DomainModel
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYNTAX_ERROR

public static final java.lang.String SYNTAX_ERROR
String constant representing syntax or compiler errors

See Also:
Constant Field Values

SEMANTIC_ERROR

public static final java.lang.String SEMANTIC_ERROR
String constant representing semantic or logic errors

See Also:
Constant Field Values

RUNTIME_ERROR

public static final java.lang.String RUNTIME_ERROR
String constant representing run-time errors

See Also:
Constant Field Values

WARNING

public static final java.lang.String WARNING
String constant representing a warning

See Also:
Constant Field Values

UNDEFINED_TYPE

public static final int UNDEFINED_TYPE
Integer constant to represent undefined data type

See Also:
Constant Field Values

UNSIGNED_SHORT

public static final int UNSIGNED_SHORT
Integer constant to represent unsigned short language-neutral meta-data type

See Also:
Constant Field Values

UNSIGNED_INTEGER

public static final int UNSIGNED_INTEGER
Integer constant to represent unsigned integer language-neutral meta-data type

See Also:
Constant Field Values

UNSIGNED_LONG

public static final int UNSIGNED_LONG
Integer constant to represent unsigned long language-neutral meta-data type

See Also:
Constant Field Values

SIGNED_SHORT

public static final int SIGNED_SHORT
Integer constant to represent signed short language-neutral meta-data type

See Also:
Constant Field Values

SIGNED_INTEGER

public static final int SIGNED_INTEGER
Integer constant to represent signed integer language-neutral meta-data type

See Also:
Constant Field Values

SIGNED_LONG

public static final int SIGNED_LONG
Integer constant to represent signed long language-neutral meta-data type

See Also:
Constant Field Values

SINGLE_PRECISION_REAL

public static final int SINGLE_PRECISION_REAL
Integer constant to represent single precision real language-neutral meta-data type

See Also:
Constant Field Values

DOUBLE_PRECISION_REAL

public static final int DOUBLE_PRECISION_REAL
Integer constant to represent double precision real language-neutral meta-data type

See Also:
Constant Field Values

QUADRUPLE_PRECISION_REAL

public static final int QUADRUPLE_PRECISION_REAL
Integer constant to represent quadruple precision real language-neutral meta-data type

See Also:
Constant Field Values

CHARACTER

public static final int CHARACTER
Integer constant to represent character language-neutral meta-data type

See Also:
Constant Field Values

BOOLEAN

public static final int BOOLEAN
Integer constant to represent boolean language-neutral meta-data type

See Also:
Constant Field Values

ERROR_TYPE

public static final int ERROR_TYPE
Integer constant to represent error language-neutral meta-data type

See Also:
Constant Field Values

EVAL_STATUS

public static final int EVAL_STATUS
Integer constant to represent evaluation status language-neutral meta-data type (such as short-circuited or skipped)

See Also:
Constant Field Values

IDENTITY

public static final int IDENTITY
The numerical identity of this class

See Also:
Constant Field Values

MIN_OBJECT_IDENTITY

public static final int MIN_OBJECT_IDENTITY
The minimum numerical identity of any domain model class

See Also:
Constant Field Values

MAX_OBJECT_IDENTITY

public static final int MAX_OBJECT_IDENTITY
The maximum numerical identity of any domain model class

See Also:
Constant Field Values

expDECLARATION

public static final int expDECLARATION
Integer constant to represent the event - declaration of a variable

See Also:
Constant Field Values

expINITIALIZATION

public static final int expINITIALIZATION
Integer constant to represent the event - initialization of a variable

See Also:
Constant Field Values

expASSIGNMENT

public static final int expASSIGNMENT
Integer constant to represent the event - assignment of a variable

See Also:
Constant Field Values

expREFERENCING

public static final int expREFERENCING
Integer constant to represent the event - referencing of a variable

See Also:
Constant Field Values

expAUTO_DEALLOCATION

public static final int expAUTO_DEALLOCATION
Integer constant to represent the event - deallocation of a variable

See Also:
Constant Field Values

expDYNAMIC_ALLOCATION

public static final int expDYNAMIC_ALLOCATION
Integer constant to represent the event - dynamic allocation of a pointer

See Also:
Constant Field Values

expDYNAMIC_ALLOCATION_INITIALIZATION

public static final int expDYNAMIC_ALLOCATION_INITIALIZATION
Integer constant to represent the event - dynamic allocation and initialization of a pointer

See Also:
Constant Field Values

expDYNAMIC_DEALLOCATION

public static final int expDYNAMIC_DEALLOCATION
Integer constant to represent the event - dynamic deallocation of a pointer

See Also:
Constant Field Values

expDEREFERENCING

public static final int expDEREFERENCING
Integer constant to represent the event - dereferencing of a pointer

See Also:
Constant Field Values

expCONDITION

public static final int expCONDITION
Integer constant to represent the event - evaluation of the condition of a selection statement

See Also:
Constant Field Values

expIF_CLAUSE

public static final int expIF_CLAUSE
Integer constant to represent the event - evaluation of the if-clause of a selection statement

See Also:
Constant Field Values

expELSE_CLAUSE

public static final int expELSE_CLAUSE
Integer constant to represent the event - evaluation of the else-clause of a selection statement

See Also:
Constant Field Values

expUPDATE

public static final int expUPDATE
Integer constant to represent the event - evaluation of the loop variable update in a loop

See Also:
Constant Field Values

expACTION

public static final int expACTION
Integer constant to represent the event - evaluation of the action of a loop

See Also:
Constant Field Values

expCALL

public static final int expCALL
Integer constant to represent the event - evaluation of a function call

See Also:
Constant Field Values

expPARAMETER_PASSING

public static final int expPARAMETER_PASSING
Integer constant to represent the event - evaluation of passing parameters to a function

See Also:
Constant Field Values

expRETURN

public static final int expRETURN
Integer constant to represent the event - evaluation of returning from a function

See Also:
Constant Field Values

expINPUT

public static final int expINPUT
Integer constant to represent the event - evaluation of an input statement

See Also:
Constant Field Values

expPRINT

public static final int expPRINT
Integer constant to represent the event - evaluation of a print statement

See Also:
Constant Field Values

expEXECUTION

public static final int expEXECUTION
Integer constant to represent the event - generic execution

See Also:
Constant Field Values

expQUESTIONABLE

public static final int expQUESTIONABLE
Integer constant to represent the event - questionable execution

See Also:
Constant Field Values

expERROR

public static final int expERROR
Integer constant to represent the event - generic error

See Also:
Constant Field Values

expSYNTAX_ERROR

public static final int expSYNTAX_ERROR
Integer constant to represent the event - syntax error

See Also:
Constant Field Values

expSEMANTIC_ERROR

public static final int expSEMANTIC_ERROR
Integer constant to represent the event - semantic error

See Also:
Constant Field Values

expRUNTIME_ERROR

public static final int expRUNTIME_ERROR
Integer constant to represent the event - run-time error

See Also:
Constant Field Values

BREAKPOINT

public static final java.lang.String BREAKPOINT
String constant to represent the breakpoint that can be used to stop execution

See Also:
Constant Field Values
Constructor Detail

DomainModel

public DomainModel()
Method Detail

clone

public java.lang.Object clone()
Returns a clone of this object, and provides the basis for cloning of derived classes

Overrides:
clone in class java.lang.Object

getId

public int getId()
Returns the numeric id of this class


getIdName

public java.lang.String getIdName(int id)
Returns a string corresponding to the event's numeric id

Parameters:
id - Integer id of an event (See event constants listed in this class)

grade

public static boolean grade(java.lang.String template,
                            java.lang.String studentCode)
Method to grade student-written code generated by this DomainModel