cmu.survey.objects
Class AnswerStub

java.lang.Object
  extended by cmu.survey.objects.AnswerStub
All Implemented Interfaces:
Answer, java.lang.Cloneable
Direct Known Subclasses:
AnswerSQL

public class AnswerStub
extends java.lang.Object
implements Answer, java.lang.Cloneable


Field Summary
protected  java.lang.String defaultValue
          The default value of the answer, if there is one.
protected  java.lang.String fieldName
          The fieldName is the unique locator -- where it is stored.
protected  java.lang.String type
           
 
Constructor Summary
AnswerStub()
           
AnswerStub(java.lang.String descriptor)
           
AnswerStub(java.lang.String type, java.lang.String theFieldName)
           
 
Method Summary
 java.lang.Object clone()
           
 java.lang.String getDefaultValue()
           
 java.lang.String getDescriptor()
          The descriptor is the label that should be used as a reference.
 java.lang.String getFieldName()
           
 java.lang.String getType()
           
 java.lang.String getValue()
           
 boolean isTypeKey()
           
 boolean isTypeNumeric()
           
 boolean isTypeString()
           
 void setDefaultValue(java.lang.String defaultValueToSet)
           
 void setFieldName(java.lang.String string)
           
 boolean setType(java.lang.String newType)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fieldName

protected java.lang.String fieldName
The fieldName is the unique locator -- where it is stored. For SQL, descriptor is the database field in the table.


defaultValue

protected java.lang.String defaultValue
The default value of the answer, if there is one. Most often, this is null -- no default value.


type

protected java.lang.String type
Constructor Detail

AnswerStub

public AnswerStub()

AnswerStub

public AnswerStub(java.lang.String descriptor)

AnswerStub

public AnswerStub(java.lang.String type,
                  java.lang.String theFieldName)
Parameters:
type -
fieldName -
Method Detail

isTypeNumeric

public boolean isTypeNumeric()
Specified by:
isTypeNumeric in interface Answer

isTypeString

public boolean isTypeString()
Specified by:
isTypeString in interface Answer

isTypeKey

public boolean isTypeKey()
Specified by:
isTypeKey in interface Answer

getDefaultValue

public java.lang.String getDefaultValue()
Specified by:
getDefaultValue in interface Answer

setDefaultValue

public void setDefaultValue(java.lang.String defaultValueToSet)
Specified by:
setDefaultValue in interface Answer

setType

public boolean setType(java.lang.String newType)
Specified by:
setType in interface Answer
Parameters:
newType -
Returns:
success or not (false means a failure)

getType

public java.lang.String getType()
Specified by:
getType in interface Answer

getDescriptor

public java.lang.String getDescriptor()
The descriptor is the label that should be used as a reference. Then, the storage class will be able to retrieve a copy of the answer from it.

Specified by:
getDescriptor in interface Answer
Returns:

getValue

public java.lang.String getValue()
Specified by:
getValue in interface Answer

getFieldName

public java.lang.String getFieldName()
Specified by:
getFieldName in interface Answer
Returns:

setFieldName

public void setFieldName(java.lang.String string)
Parameters:
string -

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object