org.problets.domain.model.implement
Class DataTraceItem

java.lang.Object
  extended by org.problets.domain.line.AbstractLine
      extended by org.problets.domain.model.implement.DataTraceItem
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
AskItem, TellItem

public abstract class DataTraceItem
extends AbstractLine
implements java.lang.Cloneable

Holds one data trace item - variable, line number and whether this is ask or tell

Author:
Amruth Kumar

Field Summary
 
Fields inherited from class org.problets.domain.line.AbstractLine
UNASSIGNED_LINE
 
Constructor Summary
DataTraceItem(AbstractVarModel inVariable, int inLineNumber)
           
 
Method Summary
abstract  boolean canEdit()
          Returns whether this object can be edited
 java.lang.Object clone()
          Clones the data trac item
 void cloneVariableValues(DataTraceItem fromItem)
          Copies the values of the variable of the given item to this item's variable
static DataTraceItem getDataTraceItem(AbstractVarModel inVariable, int inLineNumber, java.lang.String template)
           
 AbstractVarModel getVariable()
          Returns a reference to the variable
static void main(java.lang.String[] args)
           
 void print()
          Prints all the fields of the class
 void reset()
           
 void setVariable(AbstractVarModel a_var)
          Sets the variable of this item
 java.lang.String toString()
          Returns only that which is entered into the log
 boolean varsEqual(DataTraceItem a_item)
          Determines if this item's variable and the given item's variable have equal values
 
Methods inherited from class org.problets.domain.line.AbstractLine
getLineNumber, setLineNumber
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataTraceItem

public DataTraceItem(AbstractVarModel inVariable,
                     int inLineNumber)
Method Detail

getDataTraceItem

public static DataTraceItem getDataTraceItem(AbstractVarModel inVariable,
                                             int inLineNumber,
                                             java.lang.String template)

clone

public java.lang.Object clone()
Clones the data trac item

Overrides:
clone in class AbstractLine
Returns:
the cloned item

cloneVariableValues

public void cloneVariableValues(DataTraceItem fromItem)
Copies the values of the variable of the given item to this item's variable


varsEqual

public boolean varsEqual(DataTraceItem a_item)
Determines if this item's variable and the given item's variable have equal values

Parameters:
a_item - the item to compare against
Returns:
true if this item's variable and a_item's variable have the same values

getVariable

public AbstractVarModel getVariable()
Returns a reference to the variable


canEdit

public abstract boolean canEdit()
Returns whether this object can be edited


setVariable

public void setVariable(AbstractVarModel a_var)
Sets the variable of this item

Parameters:
a_var - the new variable

reset

public void reset()

toString

public java.lang.String toString()
Description copied from class: AbstractLine
Returns only that which is entered into the log

Specified by:
toString in class AbstractLine

print

public void print()
Prints all the fields of the class

Specified by:
print in class AbstractLine

main

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