com.antelmann.game.quiz
Class Question
java.lang.Object
com.antelmann.game.quiz.Question
- All Implemented Interfaces:
- Serializable
public class Question
- extends Object
- implements Serializable
- Author:
- Holger Antelmann
- See Also:
- Serialized Form
NO_CORRECT_ANSWER
public static final int NO_CORRECT_ANSWER
- See Also:
- Constant Field Values
Question
public Question(String display,
int answer,
String... option)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
Question
public Question(String display,
int answer,
long timeout,
String... option)
throws IllegalArgumentException
- constructor for a quiz question
- Parameters:
display - the question to be askedanswer - the index of the correct answer within the given options
(must be 0 <= index < option.length or NO_CORRECT_ANSWER,
if there is no correct answer to the question)option - an array of possible answers, also containing the correct answertimeout - time in milliseconds: allowed time to answer the question
(a negative number indicates no time limit)
- Throws:
IllegalArgumentException
getDisplay
public String getDisplay()
getOptions
public String[] getOptions()
getAnswer
public int getAnswer()
getTimeout
public long getTimeout()
- denotes the time allowed to answer the question (in milliseconds)
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
equals
public boolean equals(Object obj)
- based on getDisplay()
- Overrides:
equals in class Object
toString
public String toString()
- Overrides:
toString in class Object
(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads