pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.survey.model
Class QuestionGroup

java.lang.Object
  extended by org.torweg.pulse.util.entity.AbstractBasicEntity
      extended by org.torweg.pulse.component.survey.model.AbstractQuestion
          extended by org.torweg.pulse.component.survey.model.QuestionGroup
All Implemented Interfaces:
java.io.Serializable

@Entity
public class QuestionGroup
extends AbstractQuestion

For grouping of multiple AbstractQuestions.

Version:
$Revision: 1586 $
Author:
Daniel Dietz
See Also:
Serialized Form

Constructor Summary
protected QuestionGroup()
          Default constructor.
  QuestionGroup(java.util.List<AbstractQuestion> quests)
          Creates a new QuestionGroup with the given List&lt;AbstractQuestion&gt;.
 
Method Summary
 AbstractTypedAnswer<?> getAnswer(ServiceRequest request)
          Tries to extract the answer to the QuestionGroup from the given ServiceRequest.
 java.util.List<AbstractQuestion> getQuestions()
          Returns the List&lt;AbstractQuestion&gt; of the QuestionGroup.
 boolean isValid(AbstractTypedAnswer<?> answer)
          Checks the given {@code AbstractTypedAnswer<?
protected  void setQuestions(java.util.List<AbstractQuestion> quests)
          Sets the List&lt;AbstractQuestion&gt; for the QuestionGroup.
 
Methods inherited from class org.torweg.pulse.component.survey.model.AbstractQuestion
getQuestionText, isAllowBlank, setIsAllowBlank, setQuestionText
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity
compareTo, equals, getFullQualifiedClassNameJAXB, getId, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuestionGroup

protected QuestionGroup()
Default constructor.


QuestionGroup

public QuestionGroup(java.util.List<AbstractQuestion> quests)
Creates a new QuestionGroup with the given List&lt;AbstractQuestion&gt;.

Parameters:
quests - the List&lt;AbstractQuestion&gt;
Method Detail

setQuestions

protected final void setQuestions(java.util.List<AbstractQuestion> quests)
Sets the List&lt;AbstractQuestion&gt; for the QuestionGroup.

Parameters:
quests - the List&lt;AbstractQuestion&gt; to set

getQuestions

public final java.util.List<AbstractQuestion> getQuestions()
Returns the List&lt;AbstractQuestion&gt; of the QuestionGroup.

Returns:
the the List&lt;AbstractQuestion&gt; of the QuestionGroup

getAnswer

public final AbstractTypedAnswer<?> getAnswer(ServiceRequest request)
Tries to extract the answer to the QuestionGroup from the given ServiceRequest.

Specified by:
getAnswer in class AbstractQuestion
Parameters:
request - the ServiceRequest
Returns:
an AbstractTypedAnswer&lt;?&gt;; precisely a QuestionGroupAnswer

isValid

public final boolean isValid(AbstractTypedAnswer<?> answer)
Checks the given AbstractTypedAnswer&lt;?&gt; for validity.

Specified by:
isValid in class AbstractQuestion
Parameters:
answer - the AbstractTypedAnswer&lt;?&gt; to validate
Returns:
true if the AbstractTypedAnswer&lt;?&gt; is valid, false otherwise