Java Doc for Survey.java in  » XML-UI » xui32 » com » xoetrope » survey » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML UI » xui32 » com.xoetrope.survey 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.xoetrope.survey.Survey

Survey
public class Survey (Code)
An Survey contains the definition of a survey, the questions and the responses. The definitions are read from file and passed on to the question manager for rotation. The survey definition is largely independant of how the surveys are presented or rendered

Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from Xoetrope.

$Revision: 1.5 $



Field Summary
protected  intcurrentCardNumber
    
protected  QuestionGroupcurrentGroup
    
protected  intcurrentOptionNumber
    
protected  intcurrentPageNr
    
protected  XProjectcurrentProject
    
protected  QuestioncurrentQuestion
    
protected  intcurrentQuestionNumber
    
protected  Vectorgroups
    
protected  intquestionsPerPage
    
protected  XResponseSetresponseSet
    

Constructor Summary
public  Survey(String n, int qpp)
    
public  Survey(String n)
    
public  Survey()
     Creates a new nameless survey.

Method Summary
protected  voidaddCondition(Vector conditions, Question question, Option option, String answer)
    
public  voidaddGroup(QuestionGroup group)
    
public  voiddeletePageModel(int pageNr)
    
public  intgetCurrentCardNumber()
    
public  QuestionGroupgetCurrentGroup()
     Gets the current question group in the iteration through this survey.
public  StringgetCurrentGroupId()
    
public  VectorgetCurrentGroupResponses()
     Gets the responses from the current question group.
public  StringgetCurrentOptionId()
    
public  StringgetCurrentOptionText()
    
public  StringgetCurrentPageNr()
    
public  QuestiongetCurrentQuestion()
     Gets the current question in the iteration through this survey.
public  StringgetCurrentQuestionId()
    
public  intgetCurrentQuestionIndex()
    
public  StringgetCurrentQuestionText()
    
public  QuestionGroupgetGroup(int idx)
    
public  QuestionGroupgetGroupById(int groupId)
    
public  intgetGroupIdxById(int groupId)
    
public  VectorgetGroups()
    
public  intgetId()
    
public  StringgetName()
    
public  intgetNextGroupId()
    
public  StringgetNextOptionId()
    
public  StringgetNextOptionText()
    
public  QuestiongetNextQuestion()
    
public  intgetNextQuestionId()
    
public  StringgetNextQuestionText()
     Returns text of the next question in the current survey.
public  intgetNumGroups()
    
public  intgetNumQuestions()
    
public  intgetNumQuestionsPerPage()
    
public  intgetPageNrAsInt()
    
public  QuestiongetQuestionById(int questionId)
    
protected  ConditiongetResponse(Vector responses, Question question)
     Gets the user's response for the specified question.
public  XResponseSetgetResponses()
    
public  DategetStartTime()
    
public  VectorgetUserResponses()
    
public  BooleanhasMoreCards()
     Gets whether current question groups has more cards to be displayed.
public  booleanhasMoreGroups()
     Indicates whether the iteration through this survey has next question group.
public  booleanhasMoreOptions()
    
public  booleanhasMoreQuestions()
    
public  booleanhasMoreQuestionsToShow()
     Indicates whether there are more questions to show on the current page.
public  voidread(Reader r)
     Reads the survey from the input stream.
protected  voidread(ConnectionObject connObj, String surveyName, String languageCode)
    
public  voidremoveGroup(QuestionGroup group)
    
public  voidremoveQuestion(Question question)
    
public  voidresetSurvey()
     Restarts this survey.
public  voidrestart()
    
public  voidrestartSurvey()
     Restarts this survey.
public  voidsaveInHistory(String pageName)
     Saves the current survey state.
public  voidsetCurrentGroup(int groupId)
    
public  StringsetCurrentQuestion(int questionId)
     Sets the specified question as the current in the internal survey state.
public  StringsetFirstPage()
    
public  voidsetId(int i)
    
public  voidsetName(String sn)
    
public  voidsetNumQuestionsPerCard(int n)
     Sets the maximum number of questions that can be displayed on one page.
public  voidsetNumQuestionsPerPage(int qpp)
     Sets the maximum number of questions that can be displayed on a page.
public  StringsetPage(int pageNr)
     Goes through survey history, allows to show previous question page in a survey.
public  StringsetPrevPage()
     Sets the previously displayed question page as the current one.
protected  voidsetResponse(Condition response, String modelPath)
     Stores the specified response in the data model.
public  voidsetUserResponses(QuestionGroup group, Vector responses, int page)
     Saves the user given responses to the data model.
public  voidshiftToGroup(int groupId)
    
public  voidshiftToNextCard()
    
public  booleanshiftToNextGroup()
     moves survey "state" to the next question group false if the current question groupis the last one in the current survey.
public  booleanshiftToNextPage()
    
public  voidwrite(Writer w)
     Writes the current survey's data model to the output stream.
public  voidwriteUserResponses(Writer w, Vector responses)
     Saves responses from the current survey, given by the user, to the output stream.

Field Detail
currentCardNumber
protected int currentCardNumber(Code)



currentGroup
protected QuestionGroup currentGroup(Code)



currentOptionNumber
protected int currentOptionNumber(Code)



currentPageNr
protected int currentPageNr(Code)



currentProject
protected XProject currentProject(Code)
The owning project / the context for this object



currentQuestion
protected Question currentQuestion(Code)



currentQuestionNumber
protected int currentQuestionNumber(Code)



groups
protected Vector groups(Code)



questionsPerPage
protected int questionsPerPage(Code)



responseSet
protected XResponseSet responseSet(Code)




Constructor Detail
Survey
public Survey(String n, int qpp)(Code)
Creates a new instance of Survey
Parameters:
  n - the name of the survey
Parameters:
  qpp - the maximum number of questionsthat will be displayed on a page.



Survey
public Survey(String n)(Code)
Creates a new survey
Parameters:
  n - the name of the survey



Survey
public Survey()(Code)
Creates a new nameless survey.




Method Detail
addCondition
protected void addCondition(Vector conditions, Question question, Option option, String answer)(Code)
Creates and adds the new condition to the specified set of conditions
Parameters:
  conditions - Vector containing conditions to whichthe new condition will be added
Parameters:
  question - the question of the condition
Parameters:
  option - the question's option whose answer is specified
Parameters:
  answer - the answer for the specified option



addGroup
public void addGroup(QuestionGroup group)(Code)
Adds the passed question group to this survey
Parameters:
  group - the question group to be added



deletePageModel
public void deletePageModel(int pageNr)(Code)
Deletes survey history for the given page
Parameters:
  pageNr - the number of page



getCurrentCardNumber
public int getCurrentCardNumber()(Code)
Gets the number of the currently displayed card the current card number



getCurrentGroup
public QuestionGroup getCurrentGroup()(Code)
Gets the current question group in the iteration through this survey. the current question group



getCurrentGroupId
public String getCurrentGroupId()(Code)
Gets the id of the current group of this survey the current group id



getCurrentGroupResponses
public Vector getCurrentGroupResponses()(Code)
Gets the responses from the current question group. Vector containig responses



getCurrentOptionId
public String getCurrentOptionId()(Code)
Gets the id of the current option the current option id



getCurrentOptionText
public String getCurrentOptionText()(Code)
Gets the current option text text of the current option



getCurrentPageNr
public String getCurrentPageNr()(Code)
Gets the number of the current page the number of the current page



getCurrentQuestion
public Question getCurrentQuestion()(Code)
Gets the current question in the iteration through this survey. the current question



getCurrentQuestionId
public String getCurrentQuestionId()(Code)
Gest the id of the current question of this survey the id



getCurrentQuestionIndex
public int getCurrentQuestionIndex()(Code)
Gets the index of the current question the index



getCurrentQuestionText
public String getCurrentQuestionText()(Code)
Gets the text of the current question current question's text



getGroup
public QuestionGroup getGroup(int idx)(Code)
Gest the question group at the specified location
Parameters:
  idx - index of the wanted question group.



getGroupById
public QuestionGroup getGroupById(int groupId)(Code)
Gets the question group with the specified id
Parameters:
  groupId - the id of the question group whichis to be retrieved question group



getGroupIdxById
public int getGroupIdxById(int groupId)(Code)



getGroups
public Vector getGroups()(Code)
Gets the question group contained in this survey Vector containing the question groupsof this survey



getId
public int getId()(Code)
Gets the id of this survey the id



getName
public String getName()(Code)
Gets the survey name the survey name



getNextGroupId
public int getNextGroupId()(Code)
Gets the id of the next question group of this survey the id of the question group



getNextOptionId
public String getNextOptionId()(Code)
Gets the id of the next option the next option's id



getNextOptionText
public String getNextOptionText()(Code)
Gest the text of the next option in this survey text of the next option



getNextQuestion
public Question getNextQuestion()(Code)
Gets the next question in the current survey the next question



getNextQuestionId
public int getNextQuestionId()(Code)
Gest the id of the next question of this survey id the id of the next question



getNextQuestionText
public String getNextQuestionText()(Code)
Returns text of the next question in the current survey. question text



getNumGroups
public int getNumGroups()(Code)
Gets the number of question groups that this survey contains the number of groups.



getNumQuestions
public int getNumQuestions()(Code)
Get the total number of questions if this survey the number of questions in all groups



getNumQuestionsPerPage
public int getNumQuestionsPerPage()(Code)
Gets the maximum number of questions that can be displayed on a page number of questions



getPageNrAsInt
public int getPageNrAsInt()(Code)
Gets the number of the current page the number of the current page



getQuestionById
public Question getQuestionById(int questionId)(Code)
Gets the question with the specified id
Parameters:
  questionId - the id of the question the question



getResponse
protected Condition getResponse(Vector responses, Question question)(Code)
Gets the user's response for the specified question. The Condition instance is returned as it is suitable for storing user given response
Parameters:
  respones - Vector containing responses from whichthe wanted response is to be retrieved.
Parameters:
  question - the question that the response for which isto be retreived the response given by the user



getResponses
public XResponseSet getResponses()(Code)
Gets the current response set the response set



getStartTime
public Date getStartTime()(Code)
Gets the "startDate" of this survey Date the Date object



getUserResponses
public Vector getUserResponses()(Code)
Gets the responses given by the user Vector containing responses



hasMoreCards
public Boolean hasMoreCards()(Code)
Gets whether current question groups has more cards to be displayed. true if the group has more cards, falseotherwise



hasMoreGroups
public boolean hasMoreGroups()(Code)
Indicates whether the iteration through this survey has next question group. true if there is next group,false otherwise



hasMoreOptions
public boolean hasMoreOptions()(Code)
Checks whether current question in the current survey has more options false if the current option is the last one.



hasMoreQuestions
public boolean hasMoreQuestions()(Code)
Indicates whether the iteration through this survey has more question groups



hasMoreQuestionsToShow
public boolean hasMoreQuestionsToShow()(Code)
Indicates whether there are more questions to show on the current page. true if the current group has more questions, falseotherwise



read
public void read(Reader r)(Code)
Reads the survey from the input stream.
Parameters:
  r - the input stream reader.



read
protected void read(ConnectionObject connObj, String surveyName, String languageCode) throws Exception(Code)



removeGroup
public void removeGroup(QuestionGroup group)(Code)
Removes the specified question group from this survey
Parameters:
  group - the group which is to be removed



removeQuestion
public void removeQuestion(Question question)(Code)
Removes the specified question from this survey
Parameters:
  question - the question to be removed



resetSurvey
public void resetSurvey()(Code)
Restarts this survey.



restart
public void restart()(Code)



restartSurvey
public void restartSurvey()(Code)
Restarts this survey.



saveInHistory
public void saveInHistory(String pageName)(Code)
Saves the current survey state.
Parameters:
  pageName - the name of the current page



setCurrentGroup
public void setCurrentGroup(int groupId)(Code)
Sets the specified group as the current in the internal survey state
Parameters:
  groupId - the id of the question group



setCurrentQuestion
public String setCurrentQuestion(int questionId)(Code)
Sets the specified question as the current in the internal survey state.
Parameters:
  questionId - the id of the question the name of the current question



setFirstPage
public String setFirstPage()(Code)
Sets the first page as the current one the name of the current page



setId
public void setId(int i)(Code)
Sets the id of this survey
Parameters:
  i - the new id of this survey



setName
public void setName(String sn)(Code)
Sets the name of this survey
Parameters:
  sn - the survey name



setNumQuestionsPerCard
public void setNumQuestionsPerCard(int n)(Code)
Sets the maximum number of questions that can be displayed on one page.
Parameters:
  n - the new number of questions



setNumQuestionsPerPage
public void setNumQuestionsPerPage(int qpp)(Code)
Sets the maximum number of questions that can be displayed on a page.
Parameters:
  qpp - the number of questions



setPage
public String setPage(int pageNr)(Code)
Goes through survey history, allows to show previous question page in a survey.
Parameters:
  pageNr - page number page name



setPrevPage
public String setPrevPage()(Code)
Sets the previously displayed question page as the current one. the name of the current page



setResponse
protected void setResponse(Condition response, String modelPath)(Code)
Stores the specified response in the data model.
Parameters:
  response - user given response
Parameters:
  modelPath - the path to the model node where theresponse will be stored.



setUserResponses
public void setUserResponses(QuestionGroup group, Vector responses, int page)(Code)
Saves the user given responses to the data model.
Parameters:
  group - the group of questions whose responesare specified
Parameters:
  responses - the responses to be saved



shiftToGroup
public void shiftToGroup(int groupId)(Code)
Sets the current survey "state" to the begining of given question group
Parameters:
  groupId - id of the question group



shiftToNextCard
public void shiftToNextCard()(Code)
Shifts the current survey state to the next card of questions



shiftToNextGroup
public boolean shiftToNextGroup()(Code)
moves survey "state" to the next question group false if the current question groupis the last one in the current survey.



shiftToNextPage
public boolean shiftToNextPage()(Code)
Moves the current survey "state" to the next page of questions false if the current page questions was the last onein the current survey.



write
public void write(Writer w) throws IOException(Code)
Writes the current survey's data model to the output stream.



writeUserResponses
public void writeUserResponses(Writer w, Vector responses) throws IOException(Code)
Saves responses from the current survey, given by the user, to the output stream.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.