com.sun.interview
Class ListQuestion.Body

java.lang.Object
  extended by com.sun.interview.Interview
      extended by com.sun.interview.ListQuestion.Body
Enclosing class:
ListQuestion

public abstract static class ListQuestion.Body
extends Interview

A special subtype of Interview to use for the questions in the body of a loop. The body has an index, which identifies its position within the list of current loop bodies, and a summary string to identify this instance of the loop body.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.interview.Interview
Interview.BadHelpFault, Interview.Fault, Interview.HelpNotFoundFault, Interview.NotOnPathFault, Interview.Observer
 
Field Summary
 
Fields inherited from class com.sun.interview.Interview
CHECKSUM, EXPORT_IGNORE_ALL_EXCEPTIONS, EXPORT_IGNORE_NO_EXCEPTIONS, EXPORT_IGNORE_RUNTIME_EXCEPTIONS, EXTERNAL_PREF, INTERVIEW, LOCALE, MARKERS, MARKERS_PREF, QUESTION, SEMANTIC_MAX_VERSION, SEMANTIC_PRE_32, SEMANTIC_VERSION_32, SEMANTIC_VERSION_43, TEMPLATE_PREF
 
Constructor Summary
protected ListQuestion.Body(ListQuestion question, int index)
          Create an instance of a loop body.
 
Method Summary
 java.lang.String getDefaultSummary()
          Get a default summary to be used to identify this instance of the the loop body, to be used when getSummary() returns null.
 int getIndex()
          Get the position of this loop body within the set of all the loop bodies for the question.
abstract  java.lang.String getSummary()
          Get a string to uniquely identify this instance of the loop body, or null if there is insufficient information so far to make a determination.
 boolean isBodyFinishable()
          Check if this body has been completed.
 
Methods inherited from class com.sun.interview.Interview
addObserver, callInterview, clear, clearMarkedResponses, containsObserver, createChecklist, createChecklistItem, createChecklistItem, createChecklistItem, export, getAllQuestions, getCurrentQuestion, getDefaultImage, getExportIgnoreExceptionPolicy, getExternalProperties, getFirstQuestion, getHelpSet, getInterview, getInterviewSemantics, getParent, getPath, getPathToCurrent, getPropertyKeys, getQuestions, getRawPath, getResourceBundle, getResourceString, getResourceString, getRoot, getTag, getTitle, hasNext, hasValidNext, isChecklistEmpty, isChecksumValid, isEdited, isFinishable, isFirst, isInterviewFinishable, isLast, isRoot, isStarted, iteratePath, iteratePathToCurrent, last, load, load, next, pathContains, pathContains, prev, propagateTemplateForAll, readLocale, removeAllMarkers, removeMarkers, removeObserver, reset, retrieveProperty, retrieveTemplateKeys, retrieveTemplateProperty, save, setBaseTag, setCurrentQuestion, setDefaultImage, setEdited, setExportIgnoreExceptionPolicy, setFirstQuestion, setHelpSet, setHelpSet, setHelpSet, setInterviewSemantics, setResourceBundle, setResourceBundle, setTitle, storeProperty, storeTemplateProperties, storeTemplateProperty, updatePath, updatePath, verifyPathContains, writeLocale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListQuestion.Body

protected ListQuestion.Body(ListQuestion question,
                            int index)
Create an instance of a loop body.

Parameters:
question - The loop question for which this is a body instance.
index - The position of this body within the set of all the bodies. The value is normally just a hint (albeit a possibly string one). The index will be updated if necessary when the body is actually set as one of the bodies of the loop.
Method Detail

getSummary

public abstract java.lang.String getSummary()
Get a string to uniquely identify this instance of the loop body, or null if there is insufficient information so far to make a determination. The string will be used to identify the loop body to the user.

Returns:
a string to uniquely identify this instance of the loop body, or null if there is insufficient information so far to make a determination.

getIndex

public int getIndex()
Get the position of this loop body within the set of all the loop bodies for the question.

Returns:
the position of this loop body within the set of all the loop bodies for the question

getDefaultSummary

public java.lang.String getDefaultSummary()
Get a default summary to be used to identify this instance of the the loop body, to be used when getSummary() returns null. The summary will be a standard prefix string possibly followed by a number to distinguish between multiple bodies using the default summary. The default summary will be unique and persist for the life of this body or until getSummary() returns a non-null value.

Returns:
a default summary to be used to identify this instance of the the loop body, to be used when getSummary() returns null.

isBodyFinishable

public boolean isBodyFinishable()
Check if this body has been completed. It is considered to have been completed if none of the questions in this body on the current path return null as the result of getNext().

Returns:
true is this body has been completed.


Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.