org.problets.lib.io.input
Class DataInputModel

java.lang.Object
  extended by org.problets.lib.io.input.DataInputModel

public class DataInputModel
extends java.lang.Object

Provides methods to process input file that specifies the questions and answering options that must be presented to the user.

Author:
Amruth Kumar

Field Summary
static java.lang.String CHECKBOX
          String used to specify a check box question - where user can select any number of the options presented
static java.lang.String COMBOBOX
          String used to specify a combo box question - where user select one option from a drop-down box
static java.lang.String DATEINPUT
          String used to specify a question asking for a date in month/day/year format
static java.lang.String LABEL
          String used to specify uneditable text as the pre-specified answer to a question
static java.lang.String LIKERT
          String used to specify a likert question - where user can select from among 5 Likert scale options
static java.lang.String PASSWORD
          String used to specify a password question - user input is masked
static java.lang.String RADIOBUTTON
          String used to specify a radiobutton question - where user can select only one of many options
static java.lang.String RANKEDCHOICE
          String used to specify a ranked choice question - where user must uniquely rank all the presented options
static java.lang.String REQUIRED
          String used to indicate that answering a question is mandatory
static java.lang.String SUBTITLE
          String used to specify subtitle of a segment of questions - no user input is expected for a subtitle
static java.lang.String TEXT
          String used to specify output text in one-column format, usable for messages
static java.lang.String TEXTAREA
          String used to specify a text area question - where user can enter multiple lines of text
static java.lang.String TEXTFIELD
          String used to specify a text field question - where user can enter one line of text
static java.lang.String TITLE
          String used to specify title of a segment of questions - no user input is expected for a title
 
Constructor Summary
DataInputModel()
           
 
Method Summary
static java.util.Vector getContentVector(java.lang.String fileName)
          Processes the text file whose name has been provided and returns a vector of InputItem objects, each object containing information about the type (see class constants), prompt, answering options and mandatory nature of one question.
static java.util.Vector getContentVector(java.lang.String path, java.lang.String fileName)
          Processes the text file at the specified path and returns a vector of InputItem objects, each object containing information about the type (see class constants), prompt, answering options and mandatory nature of one question.
static void main(java.lang.String[] args)
          Used for testing this class
static void printQuestionnaire(java.util.Vector questionnaire)
          Prints the questions on a form
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RADIOBUTTON

public static final java.lang.String RADIOBUTTON
String used to specify a radiobutton question - where user can select only one of many options

See Also:
Constant Field Values

LIKERT

public static final java.lang.String LIKERT
String used to specify a likert question - where user can select from among 5 Likert scale options

See Also:
Constant Field Values

TEXTFIELD

public static final java.lang.String TEXTFIELD
String used to specify a text field question - where user can enter one line of text

See Also:
Constant Field Values

TEXTAREA

public static final java.lang.String TEXTAREA
String used to specify a text area question - where user can enter multiple lines of text

See Also:
Constant Field Values

COMBOBOX

public static final java.lang.String COMBOBOX
String used to specify a combo box question - where user select one option from a drop-down box

See Also:
Constant Field Values

CHECKBOX

public static final java.lang.String CHECKBOX
String used to specify a check box question - where user can select any number of the options presented

See Also:
Constant Field Values

TITLE

public static final java.lang.String TITLE
String used to specify title of a segment of questions - no user input is expected for a title

See Also:
Constant Field Values

SUBTITLE

public static final java.lang.String SUBTITLE
String used to specify subtitle of a segment of questions - no user input is expected for a subtitle

See Also:
Constant Field Values

TEXT

public static final java.lang.String TEXT
String used to specify output text in one-column format, usable for messages

See Also:
Constant Field Values

RANKEDCHOICE

public static final java.lang.String RANKEDCHOICE
String used to specify a ranked choice question - where user must uniquely rank all the presented options

See Also:
Constant Field Values

DATEINPUT

public static final java.lang.String DATEINPUT
String used to specify a question asking for a date in month/day/year format

See Also:
Constant Field Values

LABEL

public static final java.lang.String LABEL
String used to specify uneditable text as the pre-specified answer to a question

See Also:
Constant Field Values

PASSWORD

public static final java.lang.String PASSWORD
String used to specify a password question - user input is masked

See Also:
Constant Field Values

REQUIRED

public static final java.lang.String REQUIRED
String used to indicate that answering a question is mandatory

See Also:
Constant Field Values
Constructor Detail

DataInputModel

public DataInputModel()
Method Detail

getContentVector

public static java.util.Vector getContentVector(java.lang.String fileName)
Processes the text file whose name has been provided and returns a vector of InputItem objects, each object containing information about the type (see class constants), prompt, answering options and mandatory nature of one question.

Parameters:
fileName - String representing the name of the file where questions, their types and possible answering options have been listed
Returns:
Vector of InputItem objects, each representing one question

getContentVector

public static java.util.Vector getContentVector(java.lang.String path,
                                                java.lang.String fileName)
Processes the text file at the specified path and returns a vector of InputItem objects, each object containing information about the type (see class constants), prompt, answering options and mandatory nature of one question. Recommended for analyzing surveys using SurveyAnalyzer

Parameters:
path - String representing the path in the org.problets package where the input text file is located.
fileName - String representing the name of the file where questions, their types and possible answering options have been listed
Returns:
Vector of InputItem objects, each representing one question on the survey

printQuestionnaire

public static void printQuestionnaire(java.util.Vector questionnaire)
Prints the questions on a form

Parameters:
questionnaire - Vector of InputItem objects containing the questions asked on a form

main

public static void main(java.lang.String[] args)
Used for testing this class