|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.problets.lib.io.input.InputItem
public class InputItem
Holds the following information for one form question: type, question prompt, answering options and whether answering it is mandatory
Constructor Summary | |
---|---|
InputItem(java.lang.String inType)
Constructs an InputItem object of the specified type |
|
InputItem(java.util.Vector contents)
Constructs an InputItem object given a vector that specifies its type, whether answering it is mandatory (optional), the question's prompt, and answering options (optional). |
Method Summary | |
---|---|
java.lang.String[] |
getOptions()
Accessor of the answering options of this question |
java.lang.String |
getPrompt()
Accessor of the prompt of this question |
boolean |
getRequired()
Accessor of whether answering the question is mandatory |
java.lang.String |
getType()
Accessor of the type of the form question |
static void |
main(java.lang.String[] args)
Used for local testing |
void |
print()
Prints the type, prompt and answering options of this question on the console |
void |
resetRequired()
Makes it not mandatory for the user to answer this question - user can skip answering this input item |
void |
setOptions(java.lang.String[] inOptions)
Mutator for the answering options for this question |
void |
setPrompt(java.lang.String inPrompt)
Mutator for the prompt of this question |
void |
setRequired()
Makes it mandatory for the user to answer this question |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InputItem(java.lang.String inType)
inType
- String representing one of the allowed types of form questions -
See the constants declared in DataInputModel for the allowed typespublic InputItem(java.util.Vector contents)
contents
- Vector containing the following elements in order -
a valid input type (see the constants declared in
DataInputModel for the allowed types),
whether answering the question is mandatory (optional),
the prompt of the question, and answering options (optional).Method Detail |
---|
public java.lang.String getType()
public boolean getRequired()
public java.lang.String getPrompt()
public java.lang.String[] getOptions()
public void setRequired()
public void resetRequired()
public void setPrompt(java.lang.String inPrompt)
inPrompt
- String representing the new prompt for this questionpublic void setOptions(java.lang.String[] inOptions)
inOptions
- Array of strings, each representing a new answering option for this questionpublic void print()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |