public class FormEntryModel extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
REPEAT_STRUCTURE_LINEAR
Repeats should be a prompted linear set of questions, either
with a fixed set of repetitions, or a prompt for creating a
new one.
|
static int |
REPEAT_STRUCTURE_NON_LINEAR
Repeats should be a custom juncture point with centralized
"Create/Remove/Interact" hub.
|
| Constructor and Description |
|---|
FormEntryModel(FormDef form) |
FormEntryModel(FormDef form,
int repeatStructure)
Creates a new entry model for the form with the appropriate
repeat structure
|
| Modifier and Type | Method and Description |
|---|---|
FormIndex |
decrementIndex(FormIndex index) |
FormEntryCaption[] |
getCaptionHierarchy()
Returns a hierarchical list of FormEntryCaption objects for the current
FormIndex
|
FormEntryCaption[] |
getCaptionHierarchy(FormIndex index)
Returns a hierarchical list of FormEntryCaption objects for the given
FormIndex
|
FormEntryCaption |
getCaptionPrompt()
When you have a non-question event, a CaptionPrompt will have all the
information needed to display to the user.
|
FormEntryCaption |
getCaptionPrompt(FormIndex index)
When you have a non-question event, a CaptionPrompt will have all the
information needed to display to the user.
|
int |
getCompletedRelevantQuestionCount()
Not yet implemented
Should get the number of completed questions to this point.
|
FormIndex[] |
getCompoundIndices() |
FormIndex[] |
getCompoundIndices(FormIndex container) |
int |
getEvent() |
int |
getEvent(FormIndex index)
Given a FormIndex, returns the event this FormIndex represents.
|
FormDef |
getForm() |
FormIndex |
getFormIndex() |
String |
getFormTitle() |
String |
getLanguage() |
String[] |
getLanguages() |
int |
getNumQuestions() |
FormEntryPrompt |
getQuestionPrompt() |
FormEntryPrompt |
getQuestionPrompt(FormIndex index) |
int |
getRepeatStructure() |
int |
getTotalRelevantQuestionCount()
Not yet implemented
Should get the total possible questions given the current path through the form.
|
protected TreeElement |
getTreeElement(FormIndex index) |
FormIndex |
incrementIndex(FormIndex index) |
FormIndex |
incrementIndex(FormIndex index,
boolean descend) |
boolean |
isIndexCompoundContainer() |
boolean |
isIndexCompoundContainer(FormIndex index) |
boolean |
isIndexCompoundElement() |
boolean |
isIndexCompoundElement(FormIndex index) |
boolean |
isIndexReadonly() |
boolean |
isIndexReadonly(FormIndex index) |
boolean |
isIndexRelevant()
Determine if the current FormIndex is relevant.
|
boolean |
isIndexRelevant(FormIndex index)
Determine if the current FormIndex is relevant.
|
protected void |
setLanguage(String language) |
void |
setQuestionIndex(FormIndex index)
Set the FormIndex for the current question.
|
public static final int REPEAT_STRUCTURE_LINEAR
public static final int REPEAT_STRUCTURE_NON_LINEAR
public FormEntryModel(FormDef form)
public FormEntryModel(FormDef form, int repeatStructure)
form - repeatStructure - The structure of repeats (the repeat signals which should
be sent during form entry)IllegalArgumentException - If repeatStructure is not validpublic int getEvent(FormIndex index)
FormEntryControllerprotected TreeElement getTreeElement(FormIndex index)
index - public int getEvent()
FormEntryControllerpublic String getFormTitle()
public FormEntryPrompt getQuestionPrompt(FormIndex index)
index - public FormEntryPrompt getQuestionPrompt()
public FormEntryCaption getCaptionPrompt(FormIndex index)
index - public FormEntryCaption getCaptionPrompt()
public String[] getLanguages()
public int getCompletedRelevantQuestionCount()
public int getTotalRelevantQuestionCount()
public int getNumQuestions()
public FormIndex getFormIndex()
protected void setLanguage(String language)
public String getLanguage()
public void setQuestionIndex(FormIndex index)
index - public FormDef getForm()
public FormEntryCaption[] getCaptionHierarchy(FormIndex index)
index - public FormEntryCaption[] getCaptionHierarchy()
public boolean isIndexReadonly(FormIndex index)
index - public boolean isIndexReadonly()
public boolean isIndexRelevant(FormIndex index)
index - public boolean isIndexRelevant()
public boolean isIndexCompoundContainer()
public boolean isIndexCompoundContainer(FormIndex index)
public boolean isIndexCompoundElement()
public boolean isIndexCompoundElement(FormIndex index)
public FormIndex[] getCompoundIndices()
public int getRepeatStructure()
Copyright © 2020. All rights reserved.