com.objectplanet.survey.plugin.api
Class QuestionNumeric

java.lang.Object
  extended by com.objectplanet.survey.plugin.api.Question
      extended by com.objectplanet.survey.plugin.api.QuestionNumeric

public class QuestionNumeric
extends Question

This class represents a numeric question. Subclasses Question, and adds functionality to create/edit/delete a numeric question. ATTENTION: Update validators when changing numeric type (use setValidator() method). If you forget to update the validators for min and max values, parameters to these validators will be set to 0.

Author:
Irina Brun
Created:
31. march 2003

Field Summary
static int DECIMAL
          Numeric type decimal is allowed for response input
static int INTEGER
          Numeric type integer is allowed for response input (default)
 
Fields inherited from class com.objectplanet.survey.plugin.api.Question
ESSAY_FIELD_CHECKBOX, ESSAY_FIELD_DROPDOWN, ESSAY_FIELD_NUMERIC_DEC, ESSAY_FIELD_NUMERIC_INT, ESSAY_FIELD_TEXT, ESSAYFIELD_LENGTH, INTEXT_TYPE_CHECKBOX, INTEXT_TYPE_DROPDOWN, INTEXT_TYPE_NUMERIC_DEC, INTEXT_TYPE_NUMERIC_INT, INTEXT_TYPE_TEXT, QUESTION_DROPDOWN, QUESTION_MATRIX, QUESTION_MULTIPLE, QUESTION_NO_TYPE, QUESTION_NUMERIC, QUESTION_RATING, TAG_END, TAG_START, UPLOAD_IMAGE, UPLOAD_NONE
 
Method Summary
 int getFieldSize()
          Gets the field size
 int getNumericType()
          Gets the type of this numeric question
 java.lang.String getPostfixLabel()
          Gets the postfix label.
 java.lang.String getPrefixLabel()
          Gets the prefix label.
 void keepBusinessObject()
          Get and keep business object.
 void releaseBusinessObject()
          Release business object.
 void setFieldSize(int fieldSize)
          Sets the input field size.
 void setNumericType(int numericType)
          Sets the numeric type attribute
 void setPostfixLabel(java.lang.String postfixLabel)
          Sets the postfix label for the numeric input.
 void setPrefixLabel(java.lang.String prefixLabel)
          Sets the prefix label for the numeric input.
 
Methods inherited from class com.objectplanet.survey.plugin.api.Question
addEssayFieldCheckbox, addEssayFieldDecimal, addEssayFieldDropdown, addEssayFieldInteger, addEssayFieldText, addIntextCheckbox, addIntextDecimal, addIntextDropdown, addIntextInteger, addIntextText, deleteEssayField, deleteIntext, deleteValidator, deleteValidator, deleteValidator, deleteValidator, getAnswerRotation, getCustomId, getDisplayNo, getEssayFieldCount, getEssayFieldDropdownItems, getEssayFieldDropdownLabel, getEssayFieldDropdownSortOn, getEssayFieldSize, getEssayFieldType, getFreeTextColumns, getFreeTextLabel, getFreeTextMaxLength, getFreeTextRows, getIntextCount, getIntextDropdownItems, getIntextDropdownLabel, getIntextDropdownSortOn, getIntextIndex, getIntextName, getIntextSize, getIntextType, getQuestionId, getQuestionLayout, getQuestionText, getQuestionType, getTextAfter, getTextBefore, getUploadType, getValidatorErrorMessage, getValidatorErrorMessage, getValidatorErrorMessage, getValidatorErrorMessage, getValidatorParameter, getValidatorParameter, getValidatorParameter, getValidatorParameter, getWeight, hasBusinessObject, isFreeTextOn, isValidatorOn, isValidatorOn, isValidatorOn, isValidatorOn, setAnswerRotation, setDisplayNo, setFreeTextColumns, setFreeTextLabel, setFreeTextMaxLength, setFreeTextOn, setFreeTextRows, setQuestionLayout, setQuestionText, setTextAfter, setTextBefore, setUploadType, setValidator, setValidator, setValidator, setValidator, setWeight, updateAttribute, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DECIMAL

public static final int DECIMAL
Numeric type decimal is allowed for response input

See Also:
Constant Field Values

INTEGER

public static final int INTEGER
Numeric type integer is allowed for response input (default)

See Also:
Constant Field Values
Method Detail

setFieldSize

public void setFieldSize(int fieldSize)
                  throws LockException,
                         RespondentsExistException,
                         SurveySecurityException,
                         SurveySystemException
Sets the input field size.

Parameters:
fieldSize - The new field size value
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setNumericType

public void setNumericType(int numericType)
                    throws LockException,
                           RespondentsExistException,
                           SurveySecurityException,
                           SurveySystemException
Sets the numeric type attribute

Parameters:
numericType - The new numeric type
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setPostfixLabel

public void setPostfixLabel(java.lang.String postfixLabel)
                     throws LockException,
                            RespondentsExistException,
                            SurveySecurityException,
                            SurveySystemException
Sets the postfix label for the numeric input. This label will normally appear after the input field.

Parameters:
postfixLabel - The postfix label value
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setPrefixLabel

public void setPrefixLabel(java.lang.String prefixLabel)
                    throws LockException,
                           RespondentsExistException,
                           SurveySecurityException,
                           SurveySystemException
Sets the prefix label for the numeric input. This label will normally appear before the input field.

Parameters:
prefixLabel - The new prefix label value
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

getFieldSize

public int getFieldSize()
                 throws SurveySystemException
Gets the field size

Returns:
The field size
Throws:
SurveySystemException - If an error occurs in the system.

getNumericType

public int getNumericType()
                   throws SurveySystemException
Gets the type of this numeric question

Returns:
The numeric type value
Throws:
SurveySystemException - If an error occurs in the system.

getPostfixLabel

public java.lang.String getPostfixLabel()
                                 throws SurveySystemException
Gets the postfix label. This normally appears after the input field.

Returns:
The postfix label
Throws:
SurveySystemException - If an error occurs in the system.

getPrefixLabel

public java.lang.String getPrefixLabel()
                                throws SurveySystemException
Gets the prefix label. This normally appears before the input field.

Returns:
The prefix label
Throws:
SurveySystemException - If an error occurs in the system.

keepBusinessObject

public void keepBusinessObject()
                        throws SurveySystemException
Get and keep business object. See ATTENTION .

Overrides:
keepBusinessObject in class Question
Throws:
SurveySystemException - If an error occurs in the system.

releaseBusinessObject

public void releaseBusinessObject()
Release business object. See ATTENTION .

Overrides:
releaseBusinessObject in class Question

Copyright ? ObjectPlanet Inc. All Rights Reserved.

Built on December 20 2016